public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
@ 2010-11-09 11:00 rguenth at gcc dot gnu.org
  2010-11-09 11:01 ` [Bug rtl-optimization/46387] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-09 11:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

           Summary: [4.6 Regression] ICE in add_stores, at
                    var-tracking.c:5415
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: ia64-linux


Created attachment 22340
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22340
preprocessed source

gnokii fails to build on ia64 with

xgnokii_logos.c: In function 'DrawingAreaMotionNotifyEvent':
xgnokii_logos.c:902:1: internal compiler error: in add_stores, at
var-tracking.c:5415
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.
gmake[2]: *** [xgnokii-xgnokii_logos.o] Error 1

> /usr/lib/gcc/ia64-suse-linux/4.6/cc1 -fpreprocessed xgnokii_logos.i -quiet -dumpbase xgnokii_logos.c -auxbase-strip xgnokii-xgnokii_logos.o -g -O2 -fstack-protector -fvisibility=hidden  -o xgnokii_logos.s
xgnokii_logos.c: In function 'DrawingAreaMotionNotifyEvent':
xgnokii_logos.c:902:1: internal compiler error: in add_stores, at
var-tracking.c:5415
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
@ 2010-11-09 11:01 ` rguenth at gcc dot gnu.org
  2010-11-09 11:35 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-09 11:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-09 11:01:31 UTC ---
Created attachment 22341
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22341
required stack-protector support patch

Required patch.

Reducing.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
  2010-11-09 11:01 ` [Bug rtl-optimization/46387] " rguenth at gcc dot gnu.org
@ 2010-11-09 11:35 ` rguenth at gcc dot gnu.org
  2010-11-09 13:20 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-09 11:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-09 11:35:35 UTC ---
Reduced testcase, no longer requires stack-protector:

typedef signed short gint16;
typedef int gint;
typedef double gdouble;
typedef struct _GdkDrawable GdkPixmap;
typedef struct _GdkDrawable GdkWindow;
typedef enum { GDK_BUTTON1_MASK = 1 << 8 } GdkModifierType;
typedef struct _GdkEventMotion GdkEventMotion;
struct _GdkEventMotion {
    GdkWindow *window;
    gdouble x;
    gdouble y;
    gint16 is_hint;
};
typedef struct _GtkWidget GtkWidget;
typedef struct {
    unsigned char width;
} gn_bmp;
GdkPixmap *drawingPixmap = ((void *)0);
int mouseButtonPushed = 0;
gn_bmp bitmap, oldBitmap;
int activeTool = 0;
gint
DrawingAreaMotionNotifyEvent(GtkWidget * widget, GdkEventMotion * event)
{
  int x, y;
  GdkModifierType state;
  if (!mouseButtonPushed && activeTool != 0)
    return (!(0));
  if (event->is_hint)
    gdk_window_get_pointer(&x, &y, &state);
  else
    {
      x = event->x;
      y = event->y;
    }
  x = x / (5 + 1);
  y = y / (5 + 1);
  if (x < 0)
    x = 0;
  if (x > bitmap.width - 1)
    x = bitmap.width - 1;
  switch (activeTool)
    {
    case 0:
      ToolBrush(widget, x, y, 1);
    }
  return (!(0));
}

./cc1 -quiet xgnokii_logos.3.i -O2 -g 
xgnokii_logos.3.i: In function 'DrawingAreaMotionNotifyEvent':
xgnokii_logos.3.i:48:1: internal compiler error: in add_stores, at
var-tracking.c:5415
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.

reproducible with a cross to ia64-linux.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
  2010-11-09 11:01 ` [Bug rtl-optimization/46387] " rguenth at gcc dot gnu.org
  2010-11-09 11:35 ` rguenth at gcc dot gnu.org
@ 2010-11-09 13:20 ` jakub at gcc dot gnu.org
  2010-11-09 15:20 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-09 13:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-09 13:19:45 UTC ---
Reduced testcase:

struct S { double x; double y; short z; };
int a = 0, b = 0, c;
void bar (int, int, int);
void baz (int *, int *, int *);

void
foo (struct S *v)
{
  int x, y, z;
  if (!a && b != 0)
    return;
  if (v->z)
    baz (&x, &y, &z);
  else
    {
      x = v->x;
      y = v->y;
    }
  x = x / (5 + 1);
  y = y / (5 + 1);
  if (x < 0)
    x = 0;
  if (x > c - 1)
    x = c - 1;
  if (b == 0)
    bar (x, y, 1);
  return;
}

Looking into it.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-11-09 13:20 ` jakub at gcc dot gnu.org
@ 2010-11-09 15:20 ` jakub at gcc dot gnu.org
  2010-11-09 17:48 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-09 15:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-09 15:20:47 UTC ---
The interesting insns here are:

(insn:TI 70 272 60 5 (set (reg:BI 262 p6 [394])
        (ge:BI (reg:SI 16 r16 [orig:347 prephitmp.13 ] [347])
            (const_int 0 [0]))) pr46387.c:21 318 {*cmpsi_adjusted}
     (nil))

(insn 60 70 271 5 (set (mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
        (reg:SI 16 r16 [380])) pr46387.c:19 4 {movsi_internal}
     (nil))
...
(insn:TI 75 270 251 5 (cond_exec (eq (reg:BI 262 p6 [394])
            (const_int 0 [0]))
        (set (mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
            (const_int 0 [0]))) pr46387.c:22 813 {*p movsi_internal}
     (nil))
...
(insn 57 65 253 5 (set (reg:SI 14 r14 [orig:347 prephitmp.13 ] [347])
        (reg:SI 16 r16 [380])) pr46387.c:19 4 {movsi_internal}
     (expr_list:REG_DEAD (reg:SI 16 r16 [380])
        (nil)))
...
(insn 4 140 254 5 (cond_exec (eq (reg:BI 262 p6 [394])
            (const_int 0 [0]))
        (set (reg:SI 14 r14 [orig:347 prephitmp.13 ] [347])
            (const_int 0 [0]))) pr46387.c:22 813 {*p movsi_internal}
     (nil))

We use the same VALUE for r14 in insn 4 as for (if_then_else (eq (p6) (0)) (0)
(r14)).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug rtl-optimization/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2010-11-09 15:20 ` jakub at gcc dot gnu.org
@ 2010-11-09 17:48 ` jakub at gcc dot gnu.org
  2010-11-09 19:39 ` [Bug debug/46387] " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-09 17:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-09 17:48:04 UTC ---
The problem is when processing
(insn:TI 75 270 251 5 (cond_exec (eq (reg:BI 262 p6 [394])
            (const_int 0 [0]))
        (set (mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
            (const_int 0 [0]))) pr46387.c:22 813 {*p movsi_internal}
     (nil))
we don't invalidate the old mem content.  cselib_invalidate_mem is called with
mem_rtx:
(mem/c/i:SI (reg/f:DI 32 r33 [409]) [2 x+0 S4 A64])
and we see x:
(mem/c/i:SI (value/u:DI 23:3920 @0x16199f0/0x1623ec0) [2 x+0 S4 A64])
But
canon_true_dependence (mem_rtx, GET_MODE (mem_rtx), mem_addr, x, NULL_RTX,
cselib_rtx_varies_p)
returns 0, which means it is not invalidated.
debug_rtx (((cselib_val *)0x1623ec0)->locs->loc) shows:
(reg/f:DI 32 r33 [409])
debug_rtx (((cselib_val *)0x1623ec0)->locs->next->loc) shows:
(plus:DI (value/u:DI 1:1 @0x16197e0/0x166c490)
    (const_int -8 [0xfffffffffffffff8]))
and that is the whole list.  VALUE 1:1 has only one living location:
(reg/f:DI 0 ap)

find_base_term of r33 gives r12 as base though (as init_alias_analysis has been
run before vt_initialize and doesn't know about the munging vt_initialize
performs to replace sp or hfp (+ offset) with cfa_base_rtx (which is either
argp or fp).

I guess we want to (temporarily, for the rest of var-tracking) set
REG_BASE_VALUE (cfa_base_rtx) to REG_BASE_VALUE (frame_pointer_needed ?
hard_frame_pointer_rtx : stack_pointer_rtx).


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2010-11-09 17:48 ` jakub at gcc dot gnu.org
@ 2010-11-09 19:39 ` jakub at gcc dot gnu.org
  2010-11-15 12:40 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-09 19:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.11.09 19:39:29
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-09 19:39:29 UTC ---
Created attachment 22350
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22350
gcc46-pr46387.patch

Untested fix.  I agree it isn't very nice, but I don't have better ideas how to
solve this right now.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2010-11-09 19:39 ` [Bug debug/46387] " jakub at gcc dot gnu.org
@ 2010-11-15 12:40 ` rguenth at gcc dot gnu.org
  2010-11-15 20:18 ` jakub at gcc dot gnu.org
  2010-11-15 20:37 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-15 12:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2010-11-15 12:40 ` rguenth at gcc dot gnu.org
@ 2010-11-15 20:18 ` jakub at gcc dot gnu.org
  2010-11-15 20:37 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-15 20:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-15 20:07:50 UTC ---
Author: jakub
Date: Mon Nov 15 20:07:39 2010
New Revision: 166766

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166766
Log:
    PR debug/46387
    * rtl.h (vt_equate_reg_base_value): New prototype.
    * alias.c (vt_equate_reg_base_value): New function.
    * var-tracking.c (vt_init_cfa_base): Use it.

    * gcc.dg/pr46387.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr46387.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/alias.c
    trunk/gcc/rtl.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/var-tracking.c


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/46387] [4.6 Regression] ICE in add_stores, at var-tracking.c:5415
  2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2010-11-15 20:18 ` jakub at gcc dot gnu.org
@ 2010-11-15 20:37 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-15 20:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46387

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-15 20:33:46 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-11-15 20:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09 11:00 [Bug rtl-optimization/46387] New: [4.6 Regression] ICE in add_stores, at var-tracking.c:5415 rguenth at gcc dot gnu.org
2010-11-09 11:01 ` [Bug rtl-optimization/46387] " rguenth at gcc dot gnu.org
2010-11-09 11:35 ` rguenth at gcc dot gnu.org
2010-11-09 13:20 ` jakub at gcc dot gnu.org
2010-11-09 15:20 ` jakub at gcc dot gnu.org
2010-11-09 17:48 ` jakub at gcc dot gnu.org
2010-11-09 19:39 ` [Bug debug/46387] " jakub at gcc dot gnu.org
2010-11-15 12:40 ` rguenth at gcc dot gnu.org
2010-11-15 20:18 ` jakub at gcc dot gnu.org
2010-11-15 20:37 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).