Bug 740412 - internal compiler error when building ImageMagick 6.7.2-7
Summary: internal compiler error when building ImageMagick 6.7.2-7
Keywords:
Status: CLOSED DUPLICATE of bug 715336
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 15
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-21 23:04 UTC by techouse
Modified: 2011-09-22 17:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-22 17:58:50 UTC


Attachments (Terms of Use)
Preprocessed source (669.05 KB, application/octet-stream)
2011-09-21 23:04 UTC, techouse
no flags Details

Description techouse 2011-09-21 23:04:57 UTC
Created attachment 524286 [details]
Preprocessed source

Description of problem:

When I was building ImageMagick 6.7.2-7 from source I encountered an internal compiler error.


Version-Release number of selected component (if applicable):

- GCC 4.6.0 20110603 (Red Hat 4.6.0-10)


How reproducible:


Steps to Reproduce:
1. wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
2. tar zxvfl ImageMagick.tar.gz
3. cd ImageMagick-6.7.2-7
4. ./configure
5. make -j2
  
Actual results:

make -j2
make  all-am
make[1]: Entering directory `/home/techouse/Installs/ImageMagick-6.7.2-7'
  CC     ltdl/lt__strl.lo
  CC     magick/magick_libMagickCore_la-accelerate.lo
  CC     magick/magick_libMagickCore_la-animate.lo
  CC     magick/magick_libMagickCore_la-annotate.lo
  CC     magick/magick_libMagickCore_la-artifact.lo
  CC     magick/magick_libMagickCore_la-attribute.lo
  CC     magick/magick_libMagickCore_la-blob.lo
  CC     magick/magick_libMagickCore_la-cache.lo
  CC     magick/magick_libMagickCore_la-cache-view.lo
  CC     magick/magick_libMagickCore_la-cipher.lo
  CC     magick/magick_libMagickCore_la-client.lo
  CC     magick/magick_libMagickCore_la-coder.lo
  CC     magick/magick_libMagickCore_la-color.lo
  CC     magick/magick_libMagickCore_la-colormap.lo
  CC     magick/magick_libMagickCore_la-colorspace.lo
  CC     magick/magick_libMagickCore_la-compare.lo
  CC     magick/magick_libMagickCore_la-composite.lo
  CC     magick/magick_libMagickCore_la-compress.lo
  CC     magick/magick_libMagickCore_la-configure.lo
  CC     magick/magick_libMagickCore_la-constitute.lo
  CC     magick/magick_libMagickCore_la-decorate.lo
  CC     magick/magick_libMagickCore_la-delegate.lo
  CC     magick/magick_libMagickCore_la-deprecate.lo
  CC     magick/magick_libMagickCore_la-display.lo
  CC     magick/magick_libMagickCore_la-distort.lo
  CC     magick/magick_libMagickCore_la-draw.lo
  CC     magick/magick_libMagickCore_la-effect.lo
  CC     magick/magick_libMagickCore_la-enhance.lo
  CC     magick/magick_libMagickCore_la-exception.lo
  CC     magick/magick_libMagickCore_la-feature.lo
  CC     magick/magick_libMagickCore_la-fourier.lo
  CC     magick/magick_libMagickCore_la-fx.lo
  CC     magick/magick_libMagickCore_la-gem.lo
  CC     magick/magick_libMagickCore_la-geometry.lo
  CC     magick/magick_libMagickCore_la-hashmap.lo
  CC     magick/magick_libMagickCore_la-histogram.lo
  CC     magick/magick_libMagickCore_la-identify.lo
  CC     magick/magick_libMagickCore_la-image.lo
  CC     magick/magick_libMagickCore_la-image-view.lo
  CC     magick/magick_libMagickCore_la-layer.lo
  CC     magick/magick_libMagickCore_la-list.lo
  CC     magick/magick_libMagickCore_la-locale.lo
  CC     magick/magick_libMagickCore_la-log.lo
  CC     magick/magick_libMagickCore_la-magic.lo
  CC     magick/magick_libMagickCore_la-magick.lo
  CC     magick/magick_libMagickCore_la-matrix.lo
  CC     magick/magick_libMagickCore_la-memory.lo
  CC     magick/magick_libMagickCore_la-mime.lo
  CC     magick/magick_libMagickCore_la-module.lo
  CC     magick/magick_libMagickCore_la-monitor.lo
  CC     magick/magick_libMagickCore_la-montage.lo
  CC     magick/magick_libMagickCore_la-morphology.lo
  CC     magick/magick_libMagickCore_la-option.lo
  CC     magick/magick_libMagickCore_la-paint.lo
  CC     magick/magick_libMagickCore_la-pixel.lo
  CC     magick/magick_libMagickCore_la-policy.lo
  CC     magick/magick_libMagickCore_la-PreRvIcccm.lo
  CC     magick/magick_libMagickCore_la-prepress.lo
  CC     magick/magick_libMagickCore_la-property.lo
  CC     magick/magick_libMagickCore_la-profile.lo
  CC     magick/magick_libMagickCore_la-quantize.lo
  CC     magick/magick_libMagickCore_la-quantum.lo
  CC     magick/magick_libMagickCore_la-quantum-export.lo
  CC     magick/magick_libMagickCore_la-quantum-import.lo
  CC     magick/magick_libMagickCore_la-random.lo
  CC     magick/magick_libMagickCore_la-registry.lo
  CC     magick/magick_libMagickCore_la-resample.lo
  CC     magick/magick_libMagickCore_la-resize.lo
  CC     magick/magick_libMagickCore_la-resource.lo
  CC     magick/magick_libMagickCore_la-segment.lo
  CC     magick/magick_libMagickCore_la-semaphore.lo
  CC     magick/magick_libMagickCore_la-shear.lo
  CC     magick/magick_libMagickCore_la-signature.lo
  CC     magick/magick_libMagickCore_la-splay-tree.lo
  CC     magick/magick_libMagickCore_la-static.lo
  CC     magick/magick_libMagickCore_la-statistic.lo
  CC     magick/magick_libMagickCore_la-stream.lo
  CC     magick/magick_libMagickCore_la-string.lo
  CC     magick/magick_libMagickCore_la-thread.lo
  CC     magick/magick_libMagickCore_la-timer.lo
  CC     magick/magick_libMagickCore_la-token.lo
  CC     magick/magick_libMagickCore_la-transform.lo
  CC     magick/magick_libMagickCore_la-threshold.lo
  CC     magick/magick_libMagickCore_la-type.lo
  CC     magick/magick_libMagickCore_la-utility.lo
  CC     magick/magick_libMagickCore_la-version.lo
  CC     magick/magick_libMagickCore_la-widget.lo
  CC     magick/magick_libMagickCore_la-xml-tree.lo
  CC     magick/magick_libMagickCore_la-xwindow.lo
magick/xwindow.c: In function 'XMakeMagnifyImage':
magick/xwindow.c:7505:1: internal compiler error: in new_elt_loc_list, at cselib.c:238
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
  CC     coders/magick_libMagickCore_la-aai.lo
  CC     coders/magick_libMagickCore_la-art.lo
  CC     coders/magick_libMagickCore_la-avs.lo
  CC     coders/magick_libMagickCore_la-bgr.lo
  CC     coders/magick_libMagickCore_la-bmp.lo
Preprocessed source stored into /tmp/ccsNXvx8.out file, please attach this to your bugreport.
make[1]: *** [magick/magick_libMagickCore_la-xwindow.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/techouse/Installs/ImageMagick-6.7.2-7'
make: *** [all] Error 2


Expected results:

Build Process without error.

Additional info:

The line of code in question, that is magick/xwindow.c:7505, is actually just the closing curly brace of a code block. Therefore I am now pasting the whole code block which is 460 lines long and spans from line 7046 to line 7505:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   X M a k e M a g n i f y I m a g e                                         %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  XMakeMagnifyImage() magnifies a region of an X image and displays it.
%
%  The format of the XMakeMagnifyImage method is:
%
%      void XMakeMagnifyImage(display,windows)
%
%  A description of each parameter follows:
%
%    o display: Specifies a connection to an X server;  returned from
%      XOpenDisplay.
%
%    o windows: Specifies a pointer to a XWindows structure.
%
*/
MagickExport void XMakeMagnifyImage(Display *display,XWindows *windows)
{
  char
    tuple[MaxTextExtent];

  int
    y;

  MagickPixelPacket
    pixel;

  register int
    x;

  register ssize_t
    i;

  register unsigned char
    *p,
    *q;

  ssize_t
    n;

  static unsigned int
    previous_magnify = 0;

  static XWindowInfo
    magnify_window;

  unsigned int
    height,
    j,
    k,
    l,
    magnify,
    scanline_pad,
    width;

  XImage
    *ximage;

  /*
    Check boundary conditions.
  */
  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
  assert(display != (Display *) NULL);
  assert(windows != (XWindows *) NULL);
  magnify=1;
  for (n=1; n < (ssize_t) windows->magnify.data; n++)
    magnify<<=1;
  while ((magnify*windows->image.ximage->width) < windows->magnify.width)
    magnify<<=1;
  while ((magnify*windows->image.ximage->height) < windows->magnify.height)
    magnify<<=1;
  while (magnify > windows->magnify.width)
    magnify>>=1;
  while (magnify > windows->magnify.height)
    magnify>>=1;
  if (magnify != previous_magnify)
    {
      Status
        status;

      XTextProperty
        window_name;

      /*
        New magnify factor:  update magnify window name.
      */
      i=0;
      while ((1 << i) <= (int) magnify)
        i++;
      (void) FormatLocaleString(windows->magnify.name,MaxTextExtent,
        "Magnify %.20gX",(double) i);
      status=XStringListToTextProperty(&windows->magnify.name,1,&window_name);
      if (status != False)
        {
          XSetWMName(display,windows->magnify.id,&window_name);
          XSetWMIconName(display,windows->magnify.id,&window_name);
          (void) XFree((void *) window_name.value);
        }
    }
  previous_magnify=magnify;
  ximage=windows->image.ximage;
  width=(unsigned int) windows->magnify.ximage->width;
  height=(unsigned int) windows->magnify.ximage->height;
  if ((windows->magnify.x < 0) ||
      (windows->magnify.x >= windows->image.ximage->width))
    windows->magnify.x=windows->image.ximage->width >> 1;
  x=windows->magnify.x-((width/magnify) >> 1);
  if (x < 0)
    x=0;
  else
    if (x > (int) (ximage->width-(width/magnify)))
      x=ximage->width-width/magnify;
  if ((windows->magnify.y < 0) ||
      (windows->magnify.y >= windows->image.ximage->height))
    windows->magnify.y=windows->image.ximage->height >> 1;
  y=windows->magnify.y-((height/magnify) >> 1);
  if (y < 0)
    y=0;
  else
    if (y > (int) (ximage->height-(height/magnify)))
      y=ximage->height-height/magnify;
  q=(unsigned char *) windows->magnify.ximage->data;
  scanline_pad=(unsigned int) (windows->magnify.ximage->bytes_per_line-
    ((width*windows->magnify.ximage->bits_per_pixel) >> 3));
  if (ximage->bits_per_pixel < 8)
    {
      register unsigned char
        background,
        byte,
        foreground,
        p_bit,
        q_bit;

      register unsigned int
        plane;

      XPixelInfo
        *pixel_info;

      pixel_info=windows->magnify.pixel_info;
      switch (ximage->bitmap_bit_order)
      {
        case LSBFirst:
        {
          /*
            Magnify little-endian bitmap.
          */
          background=0x00;
          foreground=0x80;
          if (ximage->format == XYBitmap)
            {
              background=(unsigned char)
                (XPixelIntensity(&pixel_info->foreground_color) <
                 XPixelIntensity(&pixel_info->background_color) ?  0x80 : 0x00);
              foreground=(unsigned char)
                (XPixelIntensity(&pixel_info->background_color) <
                 XPixelIntensity(&pixel_info->foreground_color) ?  0x80 : 0x00);
              if (windows->magnify.depth > 1)
                Swap(background,foreground);
            }
          for (i=0; i < (ssize_t) height; i+=magnify)
          {
            /*
              Propogate pixel magnify rows.
            */
            for (j=0; j < magnify; j++)
            {
              p=(unsigned char *) ximage->data+y*ximage->bytes_per_line+
                ((x*ximage->bits_per_pixel) >> 3);
              p_bit=(unsigned char) (x*ximage->bits_per_pixel) & 0x07;
              q_bit=0;
              byte=0;
              for (k=0; k < width; k+=magnify)
              {
                /*
                  Propogate pixel magnify columns.
                */
                for (l=0; l < magnify; l++)
                {
                  /*
                    Propogate each bit plane.
                  */
                  for (plane=0; (int) plane < ximage->bits_per_pixel; plane++)
                  {
                    byte>>=1;
                    if (*p & (0x01 << (p_bit+plane)))
                      byte|=foreground;
                    else
                      byte|=background;
                    q_bit++;
                    if (q_bit == 8)
                      {
                        *q++=byte;
                        q_bit=0;
                        byte=0;
                      }
                  }
                }
                p_bit+=ximage->bits_per_pixel;
                if (p_bit == 8)
                  {
                    p++;
                    p_bit=0;
                  }
                if (q_bit != 0)
                  *q=byte >> (8-q_bit);
                q+=scanline_pad;
              }
            }
            y++;
          }
          break;
        }
        case MSBFirst:
        default:
        {
          /*
            Magnify big-endian bitmap.
          */
          background=0x00;
          foreground=0x01;
          if (ximage->format == XYBitmap)
            {
              background=(unsigned char)
                (XPixelIntensity(&pixel_info->foreground_color) <
                 XPixelIntensity(&pixel_info->background_color) ?  0x01 : 0x00);
              foreground=(unsigned char)
                (XPixelIntensity(&pixel_info->background_color) <
                 XPixelIntensity(&pixel_info->foreground_color) ?  0x01 : 0x00);
              if (windows->magnify.depth > 1)
                Swap(background,foreground);
            }
          for (i=0; i < (ssize_t) height; i+=magnify)
          {
            /*
              Propogate pixel magnify rows.
            */
            for (j=0; j < magnify; j++)
            {
              p=(unsigned char *) ximage->data+y*ximage->bytes_per_line+
                ((x*ximage->bits_per_pixel) >> 3);
              p_bit=(unsigned char) (x*ximage->bits_per_pixel) & 0x07;
              q_bit=0;
              byte=0;
              for (k=0; k < width; k+=magnify)
              {
                /*
                  Propogate pixel magnify columns.
                */
                for (l=0; l < magnify; l++)
                {
                  /*
                    Propogate each bit plane.
                  */
                  for (plane=0; (int) plane < ximage->bits_per_pixel; plane++)
                  {
                    byte<<=1;
                    if (*p & (0x80 >> (p_bit+plane)))
                      byte|=foreground;
                    else
                      byte|=background;
                    q_bit++;
                    if (q_bit == 8)
                      {
                        *q++=byte;
                        q_bit=0;
                        byte=0;
                      }
                  }
                }
                p_bit+=ximage->bits_per_pixel;
                if (p_bit == 8)
                  {
                    p++;
                    p_bit=0;
                  }
                if (q_bit != 0)
                  *q=byte << (8-q_bit);
                q+=scanline_pad;
              }
            }
            y++;
          }
          break;
        }
      }
    }
  else
    switch (ximage->bits_per_pixel)
    {
      case 6:
      case 8:
      {
        /*
          Magnify 8 bit X image.
        */
        for (i=0; i < (ssize_t) height; i+=magnify)
        {
          /*
            Propogate pixel magnify rows.
          */
          for (j=0; j < magnify; j++)
          {
            p=(unsigned char *) ximage->data+y*ximage->bytes_per_line+
              ((x*ximage->bits_per_pixel) >> 3);
            for (k=0; k < width; k+=magnify)
            {
              /*
                Propogate pixel magnify columns.
              */
              for (l=0; l < magnify; l++)
                *q++=(*p);
              p++;
            }
            q+=scanline_pad;
          }
          y++;
        }
        break;
      }
      default:
      {
        register unsigned int
          bytes_per_pixel,
          m;

        /*
          Magnify multi-byte X image.
        */
        bytes_per_pixel=(unsigned int) ximage->bits_per_pixel >> 3;
        for (i=0; i < (ssize_t) height; i+=magnify)
        {
          /*
            Propogate pixel magnify rows.
          */
          for (j=0; j < magnify; j++)
          {
            p=(unsigned char *) ximage->data+y*ximage->bytes_per_line+
              ((x*ximage->bits_per_pixel) >> 3);
            for (k=0; k < width; k+=magnify)
            {
              /*
                Propogate pixel magnify columns.
              */
              for (l=0; l < magnify; l++)
                for (m=0; m < bytes_per_pixel; m++)
                  *q++=(*(p+m));
              p+=bytes_per_pixel;
            }
            q+=scanline_pad;
          }
          y++;
        }
        break;
      }
    }
  /*
    Copy X image to magnify pixmap.
  */
  x=windows->magnify.x-((width/magnify) >> 1);
  if (x < 0)
    x=(int) ((width >> 1)-windows->magnify.x*magnify);
  else
    if (x > (int) (ximage->width-(width/magnify)))
      x=(int) ((ximage->width-windows->magnify.x)*magnify-(width >> 1));
    else
      x=0;
  y=windows->magnify.y-((height/magnify) >> 1);
  if (y < 0)
    y=(int) ((height >> 1)-windows->magnify.y*magnify);
  else
    if (y > (int) (ximage->height-(height/magnify)))
      y=(int) ((ximage->height-windows->magnify.y)*magnify-(height >> 1));
    else
      y=0;
  if ((x != 0) || (y != 0))
    (void) XFillRectangle(display,windows->magnify.pixmap,
      windows->magnify.annotate_context,0,0,width,height);
  (void) XPutImage(display,windows->magnify.pixmap,
    windows->magnify.annotate_context,windows->magnify.ximage,0,0,x,y,width-x,
    height-y);
  if ((magnify > 1) && ((magnify <= (width >> 1)) &&
      (magnify <= (height >> 1))))
    {
      RectangleInfo
        highlight_info;

      /*
        Highlight center pixel.
      */
      highlight_info.x=(ssize_t) windows->magnify.width >> 1;
      highlight_info.y=(ssize_t) windows->magnify.height >> 1;
      highlight_info.width=magnify;
      highlight_info.height=magnify;
      (void) XDrawRectangle(display,windows->magnify.pixmap,
        windows->magnify.highlight_context,(int) highlight_info.x,
        (int) highlight_info.y,(unsigned int) highlight_info.width-1,
        (unsigned int) highlight_info.height-1);
      if (magnify > 2)
        (void) XDrawRectangle(display,windows->magnify.pixmap,
          windows->magnify.annotate_context,(int) highlight_info.x+1,
          (int) highlight_info.y+1,(unsigned int) highlight_info.width-3,
          (unsigned int) highlight_info.height-3);
    }
  /*
    Show center pixel color.
  */
  (void) GetOneVirtualMagickPixel(windows->image.image,(ssize_t)
    windows->magnify.x,(ssize_t) windows->magnify.y,&pixel,
    &windows->image.image->exception);
  (void) FormatLocaleString(tuple,MaxTextExtent,"%d,%d: ",
    windows->magnify.x,windows->magnify.y);
  (void) ConcatenateMagickString(tuple,"(",MaxTextExtent);
  ConcatenateColorComponent(&pixel,RedChannel,X11Compliance,tuple);
  (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
  ConcatenateColorComponent(&pixel,GreenChannel,X11Compliance,tuple);
  (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
  ConcatenateColorComponent(&pixel,BlueChannel,X11Compliance,tuple);
  if (pixel.colorspace == CMYKColorspace)
    {
      (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
      ConcatenateColorComponent(&pixel,IndexChannel,X11Compliance,tuple);
    }
  if (pixel.matte != MagickFalse)
    {
      (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
      ConcatenateColorComponent(&pixel,OpacityChannel,X11Compliance,tuple);
    }
  (void) ConcatenateMagickString(tuple,")",MaxTextExtent);
  height=(unsigned int) windows->magnify.font_info->ascent+
    windows->magnify.font_info->descent;
  x=windows->magnify.font_info->max_bounds.width >> 1;
  y=windows->magnify.font_info->ascent+(height >> 2);
  (void) XDrawImageString(display,windows->magnify.pixmap,
    windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple));
  GetColorTuple(&pixel,MagickTrue,tuple);
  y+=height;
  (void) XDrawImageString(display,windows->magnify.pixmap,
    windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple));
  (void) QueryMagickColorname(windows->image.image,&pixel,SVGCompliance,tuple,
     &windows->image.image->exception);
  y+=height;
  (void) XDrawImageString(display,windows->magnify.pixmap,
    windows->magnify.annotate_context,x,y,tuple,(int) strlen(tuple));
  /*
    Refresh magnify window.
  */
  magnify_window=windows->magnify;
  magnify_window.x=0;
  magnify_window.y=0;
  XRefreshWindow(display,&magnify_window,(XEvent *) NULL);
}

Comment 1 Jakub Jelinek 2011-09-22 05:43:20 UTC
Please see what the compiler wrote:
Preprocessed source stored into /tmp/ccsNXvx8.out file, please attach this to your bugreport.

Comment 2 techouse 2011-09-22 08:47:53 UTC
(In reply to comment #1)
> Please see what the compiler wrote:
> Preprocessed source stored into /tmp/ccsNXvx8.out file, please attach this to
> your bugreport.

I already did that. The attached file 'Preprocessed source' is /tmp/ccsNXvx8.out

Comment 3 Jakub Jelinek 2011-09-22 08:50:02 UTC
Sorry, I've missed that.  Will look into it.

Comment 4 Jakub Jelinek 2011-09-22 17:58:50 UTC
gcc-4.6.1-9.fc15 is in testing (for a long time, feel free to test it and give it karma:
https://admin.fedoraproject.org/updates/FEDORA-2011-11526?_csrf_token=55684ec01bf79877f7f59736d934a16f020e4018
).

*** This bug has been marked as a duplicate of bug 715336 ***


Note You need to log in before you can comment on or make changes to this bug.