public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/35225]  New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
@ 2008-02-17  8:11 vapier at gentoo dot org
  2008-02-17  8:13 ` [Bug target/35225] " vapier at gentoo dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vapier at gentoo dot org @ 2008-02-17  8:11 UTC (permalink / raw)
  To: gcc-bugs

the attached test case (which comes from GTK+) causes GCC to ICE due to the -O2
-fPIC flags:

sh4-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"Gtk\"
-DGTK_LIBDIR=\"/usr/lib\" -DGTK_DATADIR=\"/usr/share\" -DGTK_
DATA_PREFIX=\"/usr\" -DGTK_SYSCONFDIR=\"/etc\" -DGTK_VERSION=\"2.12.7\"
-DGTK_BINARY_VERSION=\"2.10.0\" -DGTK_HOST=\"sh4-unknown-linux-gnu\"
 -DGTK_COMPILATION -DGTK_PRINT_BACKENDS=\"file,lpr\"
"-DGTK_PRINT_PREVIEW_COMMAND=\"evince --unlink-tempfile --preview
--print-settings %s %
f\"" -I../gtk -I.. -I../gdk -I../gdk -I../gdk-pixbuf -I../gdk-pixbuf
-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_FILE_SYS
TEM_ENABLE_UNSUPPORTED -DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED
-DG_DISABLE_CAST_CHECKS -pthread -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/l
ib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo
-I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -
I/usr/include/atk-1.0 -pipe -O2 -Wall -MT gtknotebook.lo -MD -MP -MF
.deps/gtknotebook.Tpo -c gtknotebook.c  -fPIC -DPIC -o .libs/gtknoteboo
k.o
gtknotebook.c: In function 'gtk_notebook_set_focus_child':
gtknotebook.c:3927: warning: dereferencing type-punned pointer will break
strict-aliasing rules
gtknotebook.c:3930: warning: dereferencing type-punned pointer will break
strict-aliasing rules
gtknotebook.c: In function 'gtk_notebook_real_remove':
gtknotebook.c:4378: warning: dereferencing type-punned pointer will break
strict-aliasing rules
gtknotebook.c: In function 'gtk_notebook_calculate_tabs_allocation':
gtknotebook.c:5488: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Preprocessed source stored into /tmp/cc3v7chW.out file, please attach this to
your bugreport.

gcc-4.2.2 and gcc-4.2.3 fail while gcc-4.1.1 works.  occurs both natively on sh
and when cross-compiling from powerpc.


-- 
           Summary: [4.2 regression] gcc segfaults when building GTK+ code
                    with -O2 -fPIC for SH4
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vapier at gentoo dot org
GCC target triplet: sh4-linux-gnu


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
@ 2008-02-17  8:13 ` vapier at gentoo dot org
  2008-02-17  8:15 ` vapier at gentoo dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vapier at gentoo dot org @ 2008-02-17  8:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from vapier at gentoo dot org  2008-02-17 08:12 -------
Created an attachment (id=15172)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15172&action=view)
PR35225-reduced.i


-- 


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
  2008-02-17  8:13 ` [Bug target/35225] " vapier at gentoo dot org
@ 2008-02-17  8:15 ` vapier at gentoo dot org
  2008-02-17 11:57 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vapier at gentoo dot org @ 2008-02-17  8:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from vapier at gentoo dot org  2008-02-17 08:14 -------
Created an attachment (id=15173)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15173&action=view)
PR35225-orig.i


-- 


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
  2008-02-17  8:13 ` [Bug target/35225] " vapier at gentoo dot org
  2008-02-17  8:15 ` vapier at gentoo dot org
@ 2008-02-17 11:57 ` rguenth at gcc dot gnu dot org
  2008-02-18  4:36 ` kkojima at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-17 11:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |4.2.4


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
                   ` (2 preceding siblings ...)
  2008-02-17 11:57 ` rguenth at gcc dot gnu dot org
@ 2008-02-18  4:36 ` kkojima at gcc dot gnu dot org
  2008-02-20 23:39 ` kkojima at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2008-02-18  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kkojima at gcc dot gnu dot org  2008-02-18 04:36 -------
It seems that sh.c:find_barrier doesn't handle a corner case
which occurs with the testcase.  Although the given testcases
don't fail on 4.3, it'd be a hidden issue even on trunk.  Now
I'm testing the patch below.
I'll apply it on trunk first and then 4.2/4.3 if it survives
with usual tests after we are out of a current critical section
for branching.

diff -uprN ORIG/gcc-4_2-branch/gcc/config/sh/sh.c
LOCAL/gcc-4_2-branch/gcc/config/sh/sh.c
--- ORIG/gcc-4_2-branch/gcc/config/sh/sh.c      2008-01-18 22:11:17.000000000
+0900
+++ LOCAL/gcc-4_2-branch/gcc/config/sh/sh.c     2008-02-18 11:25:56.000000000
+0900
@@ -3530,6 +3530,7 @@ find_barrier (int num_mova, rtx mova, rt
   rtx barrier_before_mova = 0, found_barrier = 0, good_barrier = 0;
   int si_limit;
   int hi_limit;
+  rtx orig = from;

   /* For HImode: range is 510, add 4 because pc counts from address of
      second instruction after this one, subtract 2 for the jump instruction
@@ -3753,7 +3754,8 @@ find_barrier (int num_mova, rtx mova, rt
       /* If we exceeded the range, then we must back up over the last
         instruction we looked at.  Otherwise, we just need to undo the
         NEXT_INSN at the end of the loop.  */
-      if (count_hi > hi_limit || count_si > si_limit)
+      if (PREV_INSN (from) != orig
+         && (count_hi > hi_limit || count_si > si_limit))
        from = PREV_INSN (PREV_INSN (from));
       else
        from = PREV_INSN (from);


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-18 04:36:05
               date|                            |


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
                   ` (3 preceding siblings ...)
  2008-02-18  4:36 ` kkojima at gcc dot gnu dot org
@ 2008-02-20 23:39 ` kkojima at gcc dot gnu dot org
  2008-03-09 23:32 ` kkojima at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2008-02-20 23:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kkojima at gcc dot gnu dot org  2008-02-20 23:38 -------
Subject: Bug 35225

Author: kkojima
Date: Wed Feb 20 23:37:58 2008
New Revision: 132503

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132503
Log:
        PR target/35225
        * config/sh/sh.c (find_barrier): Don't go past 'from' argument.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/sh.c


-- 


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
                   ` (4 preceding siblings ...)
  2008-02-20 23:39 ` kkojima at gcc dot gnu dot org
@ 2008-03-09 23:32 ` kkojima at gcc dot gnu dot org
  2008-03-09 23:41 ` kkojima at gcc dot gnu dot org
  2008-03-09 23:45 ` kkojima at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2008-03-09 23:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from kkojima at gcc dot gnu dot org  2008-03-09 23:32 -------
Subject: Bug 35225

Author: kkojima
Date: Sun Mar  9 23:31:26 2008
New Revision: 133065

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133065
Log:
        Backport from mainline:
        PR target/35225
        * config/sh/sh.c (find_barrier): Don't go past 'from' argument.


Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/sh/sh.c


-- 


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
                   ` (5 preceding siblings ...)
  2008-03-09 23:32 ` kkojima at gcc dot gnu dot org
@ 2008-03-09 23:41 ` kkojima at gcc dot gnu dot org
  2008-03-09 23:45 ` kkojima at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2008-03-09 23:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from kkojima at gcc dot gnu dot org  2008-03-09 23:40 -------
Subject: Bug 35225

Author: kkojima
Date: Sun Mar  9 23:39:51 2008
New Revision: 133066

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133066
Log:
        Backport from mainline:
        PR target/35225
        * config/sh/sh.c (find_barrier): Don't go past 'from' argument.


Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/config/sh/sh.c


-- 


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


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

* [Bug target/35225] [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4
  2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
                   ` (6 preceding siblings ...)
  2008-03-09 23:41 ` kkojima at gcc dot gnu dot org
@ 2008-03-09 23:45 ` kkojima at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2008-03-09 23:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from kkojima at gcc dot gnu dot org  2008-03-09 23:45 -------
Fixed.


-- 

kkojima at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-03-09 23:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-17  8:11 [Bug target/35225] New: [4.2 regression] gcc segfaults when building GTK+ code with -O2 -fPIC for SH4 vapier at gentoo dot org
2008-02-17  8:13 ` [Bug target/35225] " vapier at gentoo dot org
2008-02-17  8:15 ` vapier at gentoo dot org
2008-02-17 11:57 ` rguenth at gcc dot gnu dot org
2008-02-18  4:36 ` kkojima at gcc dot gnu dot org
2008-02-20 23:39 ` kkojima at gcc dot gnu dot org
2008-03-09 23:32 ` kkojima at gcc dot gnu dot org
2008-03-09 23:41 ` kkojima at gcc dot gnu dot org
2008-03-09 23:45 ` kkojima at gcc dot gnu dot 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).