public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25248]  New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
@ 2005-12-04  1:32 olh at suse dot de
  2005-12-04  1:36 ` [Bug c/25248] " olh at suse dot de
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-04  1:32 UTC (permalink / raw)
  To: gcc-bugs

current kernels do not boot, they hang after 'returning from prom_init'
gcc4.1 and mainline miscompile arch/powerpc/mm/hash_utils_64.c.
Taking the object file from a gcc4.0 compiled tree fixes booting.

gcc-mainline r108000 binutils-mainline -> fails
gcc-4_0-branch r107977 binutils-mainline -> works
gcc-4_1-branch r106530 (+patch r106693 from bug #24644) binutils-mainline
2005-11-05 -> fails


-- 
           Summary: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: olh at suse dot de
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


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

* [Bug c/25248] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
@ 2005-12-04  1:36 ` olh at suse dot de
  2005-12-04  2:19 ` [Bug middle-end/25248] " pinskia at gcc dot gnu dot org
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-04  1:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from olh at suse dot de  2005-12-04 01:36 -------
Created an attachment (id=10400)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10400&action=view)
PR25248.tar.bz2

buildscripts and preprocessed files.


-- 


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


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

* [Bug middle-end/25248] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
  2005-12-04  1:36 ` [Bug c/25248] " olh at suse dot de
@ 2005-12-04  2:19 ` pinskia at gcc dot gnu dot org
  2005-12-04 16:43 ` olh at suse dot de
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-04  2:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-12-04 02:19 -------
As far as I can see, the tree level is fine.


-- 


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


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

* [Bug middle-end/25248] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
  2005-12-04  1:36 ` [Bug c/25248] " olh at suse dot de
  2005-12-04  2:19 ` [Bug middle-end/25248] " pinskia at gcc dot gnu dot org
@ 2005-12-04 16:43 ` olh at suse dot de
  2005-12-04 18:17 ` olh at suse dot de
                   ` (23 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-04 16:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from olh at suse dot de  2005-12-04 16:43 -------
an object file compiled with r102096 doesnt work either. 
Will try older ones.


-- 


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


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

* [Bug middle-end/25248] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (2 preceding siblings ...)
  2005-12-04 16:43 ` olh at suse dot de
@ 2005-12-04 18:17 ` olh at suse dot de
  2005-12-04 19:24 ` [Bug middle-end/25248] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-04 18:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from olh at suse dot de  2005-12-04 18:17 -------
Created an attachment (id=10402)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10402&action=view)
PR25248-2.tar.bz2

this change breaks it. I replaced only arch/powerpc/mm/hash_utils_64.o in my
tests.

r99558 | dnovillo | 2005-05-11 04:24:44 +0200 (Wed, 11 May 2005) | 16 lines
* tree-optimize.c (init_tree_optimization_passes): Re-organize
optimization passes to do an initial batch of scalar cleanups.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (3 preceding siblings ...)
  2005-12-04 18:17 ` olh at suse dot de
@ 2005-12-04 19:24 ` pinskia at gcc dot gnu dot org
  2005-12-04 20:58 ` olh at suse dot de
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-04 19:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-12-04 19:24 -------
(In reply to comment #4)
> Created an attachment (id=10402)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10402&action=view) [edit]
> PR25248-2.tar.bz2
> this change breaks it. I replaced only arch/powerpc/mm/hash_utils_64.o in my
> tests.

That would mean there is a latent bug somewhere.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
            Summary|2.6.15-rc4                  |[4.1/4.2 Regression] 2.6.15-
                   |arch/powerpc/mm/hash_utils_6|rc4
                   |4.c miscompiled             |arch/powerpc/mm/hash_utils_6
                   |                            |4.c miscompiled
   Target Milestone|---                         |4.1.0


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (4 preceding siblings ...)
  2005-12-04 19:24 ` [Bug middle-end/25248] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2005-12-04 20:58 ` olh at suse dot de
  2005-12-04 23:17 ` giovannibajo at libero dot it
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-04 20:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from olh at suse dot de  2005-12-04 20:58 -------
Created an attachment (id=10403)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10403&action=view)
PR25248-3.tar.bz2

If someone can spot the bug, I cant.

Unified all asm labels to reduce diff noise.
The object file prevents booting also in a gcc 4.0 compiled kernel.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (5 preceding siblings ...)
  2005-12-04 20:58 ` olh at suse dot de
@ 2005-12-04 23:17 ` giovannibajo at libero dot it
  2005-12-06  1:57 ` bergner at vnet dot ibm dot com
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: giovannibajo at libero dot it @ 2005-12-04 23:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from giovannibajo at libero dot it  2005-12-04 23:17 -------
Further bonus points if you can spot which function is miscompiled.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (6 preceding siblings ...)
  2005-12-04 23:17 ` giovannibajo at libero dot it
@ 2005-12-06  1:57 ` bergner at vnet dot ibm dot com
  2005-12-06  6:26 ` bergner at vnet dot ibm dot com
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-12-06  1:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from bergner at vnet dot ibm dot com  2005-12-06 01:57 -------
We're miscompiling htab_bolt_mapping().  What do I win? ;-)
I have a userland test case which I'll attach once I've shunk it down a little.


-- 

bergner at vnet dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at vnet dot ibm dot
                   |                            |com


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (7 preceding siblings ...)
  2005-12-06  1:57 ` bergner at vnet dot ibm dot com
@ 2005-12-06  6:26 ` bergner at vnet dot ibm dot com
  2005-12-06  8:38 ` olh at suse dot de
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-12-06  6:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from bergner at vnet dot ibm dot com  2005-12-06 06:26 -------
Created an attachment (id=10414)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10414&action=view)
Minimal test case.

Here's a minimal test case.  This works with older gcc's and without
optimization on newer gcc's (.

bergner@vervain:~/PR25248> gcc3.3.3 -m64 -O1 hash_utils_64.c
bergner@vervain:~/PR25248> ./a.out
addr = 0x0000000000001000
bergner@vervain:~/PR25248> gcc4.1 -m64 -O0 hash_utils_64.c
bergner@vervain:~/PR25248> ./a.out
addr = 0x0000000000001000
bergner@vervain:~/PR25248> gcc41 -m64 -O1 hash_utils_64.c
bergner@vervain:~/PR25248> ./a.out
addr = 0x4000000000001000


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (8 preceding siblings ...)
  2005-12-06  6:26 ` bergner at vnet dot ibm dot com
@ 2005-12-06  8:38 ` olh at suse dot de
  2005-12-06  8:44 ` olh at suse dot de
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-06  8:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from olh at suse dot de  2005-12-06 08:38 -------
Odd, -O1 doesnt fix it for me:

+CFLAGS_hash_utils_64.o      += -O1

gcc version 4.2.0 20051206 (experimental)
GNU ld version 2.16.91 20051206


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (9 preceding siblings ...)
  2005-12-06  8:38 ` olh at suse dot de
@ 2005-12-06  8:44 ` olh at suse dot de
  2005-12-06 13:37 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-06  8:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from olh at suse dot de  2005-12-06 08:44 -------
same is true for a r99558 compiled object file, in a gcc40 kernel.
-O1 doesnt help there.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (10 preceding siblings ...)
  2005-12-06  8:44 ` olh at suse dot de
@ 2005-12-06 13:37 ` rguenth at gcc dot gnu dot org
  2005-12-06 13:39 ` rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-06 13:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2005-12-06 13:37 -------
Note that in the reduced testcase we have

pr25248.c: In function ?htab_bolt_mapping?:
pr25248.c:15: warning: integer constant is too large for ?unsigned long? type
pr25248.c: In function ?main?:
pr25248.c:24: warning: integer constant is too large for ?unsigned long? type
pr25248.c:24: warning: large integer implicitly truncated to unsigned type

because on ppc64 long is 4 bytes.  Using long long fixes the problem.  Can
someone confirm that this is also the problem with the original testcase (and
close the bug as INVALID)?

Thanks.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (11 preceding siblings ...)
  2005-12-06 13:37 ` rguenth at gcc dot gnu dot org
@ 2005-12-06 13:39 ` rguenth at gcc dot gnu dot org
  2005-12-06 13:40 ` bergner at vnet dot ibm dot com
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-06 13:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2005-12-06 13:39 -------
hmhm, maybe I'm in a ppc32 chroot.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (12 preceding siblings ...)
  2005-12-06 13:39 ` rguenth at gcc dot gnu dot org
@ 2005-12-06 13:40 ` bergner at vnet dot ibm dot com
  2005-12-06 13:43 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-12-06 13:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from bergner at vnet dot ibm dot com  2005-12-06 13:40 -------
sizeof(unsigned long) and sizeof(unsigned long long) are both 8 bytes on ppc64.

Olaf, -O1 isn't a workaround, it's the minimum optimization level that still
shows the bug.  Trying some -fno-* options, using -fno-tree-loop-optimize makes
the problem go away at least on the test case:

bergner@vervain:~/PR25248> gcc4.1 -m64 -O2 -fno-tree-loop-optimize
hash_utils_64.c
bergner@vervain:~/PR25248> ./a.out
addr = 0x0000000000001000


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (13 preceding siblings ...)
  2005-12-06 13:40 ` bergner at vnet dot ibm dot com
@ 2005-12-06 13:43 ` rguenth at gcc dot gnu dot org
  2005-12-06 13:48 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-06 13:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2005-12-06 13:43 -------
So, CCing zdenek.  Btw., checking -floop-optimize2 may also be worth trying
(setting up a rpoper chroot now).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (14 preceding siblings ...)
  2005-12-06 13:43 ` rguenth at gcc dot gnu dot org
@ 2005-12-06 13:48 ` rguenth at gcc dot gnu dot org
  2005-12-06 13:59 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-06 13:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2005-12-06 13:48 -------
Confirmed.  -fno-ivopts fixes it.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-12-06 13:48:29
               date|                            |


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (15 preceding siblings ...)
  2005-12-06 13:48 ` rguenth at gcc dot gnu dot org
@ 2005-12-06 13:59 ` rguenth at gcc dot gnu dot org
  2005-12-06 14:26 ` olh at suse dot de
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-06 13:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2005-12-06 13:59 -------
IVOPTs truncates pstartD.1866_10 down to int, which is wrong:

htab_bolt_mapping (pstartD.1866, cntD.1867)
{
  unsigned intD.3 D.1959;
  long unsigned intD.4 D.1960;
  long unsigned intD.4 ivtmp.50D.1954;
  unsigned intD.3 stepD.1871;
  long unsigned intD.4 iD.1870;
  intD.0 D.1881;
  long unsigned intD.4 D.1880;
  long unsigned intD.4 D.1879;
  unsigned intD.3 cond.12D.1878;
  intD.0 D.1877;
  intD.0 shift.11D.1876;
  unsigned intD.3 shift.10D.1875;

<bb 0>:
  shift.10D.1875_5 = shiftD.1865;
  shift.11D.1876_6 = (intD.0) shift.10D.1875_5;
  D.1877_7 = 1 << shift.11D.1876_6;
  stepD.1871_8 = (unsigned intD.3) D.1877_7;
  if (cntD.1867_11 != 0) goto <L9>; else goto <L4>;

<L9>:;
  ivtmp.50D.1954_21 = (long unsigned intD.4) stepD.1871_8;
  D.1959_23 = (unsigned intD.3) pstartD.1866_10;
  D.1960_26 = (long unsigned intD.4) D.1959_23;
  ivtmp.50D.1954_3 = D.1960_26 - 000000000;

  # ivtmp.50D.1954_1 = PHI <ivtmp.50D.1954_2(5), ivtmp.50D.1954_3(1)>;
  # iD.1870_28 = PHI <iD.1870_18(5), 0(1)>;
<L0>:;
  cond.12D.1878_15 = condD.1864;
  if (cond.12D.1878_15 != 0) goto <L1>; else goto <L2>;


before we have (cunroll):

<bb 0>:
  shift.10D.1875_5 = shiftD.1865;
  shift.11D.1876_6 = (intD.0) shift.10D.1875_5;
  D.1877_7 = 1 << shift.11D.1876_6;
  stepD.1871_8 = (unsigned intD.3) D.1877_7;
  if (cntD.1867_11 != 0) goto <L9>; else goto <L4>;

<L9>:;

  # iD.1870_28 = PHI <iD.1870_18(5), 0(1)>;
  # pstartD.1866_27 = PHI <pstartD.1866_17(5), pstartD.1866_10(1)>;
<L0>:;
  cond.12D.1878_15 = condD.1864;
  if (cond.12D.1878_15 != 0) goto <L1>; else goto <L2>;


Zdenek surely knows where this happens and how to best fix it.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (16 preceding siblings ...)
  2005-12-06 13:59 ` rguenth at gcc dot gnu dot org
@ 2005-12-06 14:26 ` olh at suse dot de
  2005-12-06 15:28 ` rakdver at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-06 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from olh at suse dot de  2005-12-06 14:26 -------
Adding -fno-ivopts to CFLAGS for hash_utils_64.o fixes it for me.
Tested with gcc-4_1-branch r108104 and current binutils.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (17 preceding siblings ...)
  2005-12-06 14:26 ` olh at suse dot de
@ 2005-12-06 15:28 ` rakdver at gcc dot gnu dot org
  2005-12-06 15:43 ` rakdver at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-12-06 15:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from rakdver at gcc dot gnu dot org  2005-12-06 15:28 -------
Seems like some problem in iv analysis:

ssa name pstart_17
  type long unsigned int
  base (long unsigned int) (unsigned int) D.1301_7 + (long unsigned int)
(unsigned int) pstart_10
  step (long unsigned int) step_8
  is a biv


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (18 preceding siblings ...)
  2005-12-06 15:28 ` rakdver at gcc dot gnu dot org
@ 2005-12-06 15:43 ` rakdver at gcc dot gnu dot org
  2005-12-06 18:11 ` olh at suse dot de
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-12-06 15:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from rakdver at gcc dot gnu dot org  2005-12-06 15:43 -------
This patch should fix the problem:

Index: tree-scalar-evolution.c
===================================================================
*** tree-scalar-evolution.c     (revision 108078)
--- tree-scalar-evolution.c     (working copy)
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1042,1047 ****
--- 1042,1048 ----
    t_bool res = t_false;
    tree rhs0, rhs1;
    tree type_rhs = TREE_TYPE (rhs);
+   tree evol;

    /* The RHS is one of the following cases:
       - an SSA_NAME,
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1084,1097 ****
            {
              /* Match an assignment under the form:
                 "a = b + c".  */
              res = follow_ssa_edge
                (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
!                evolution_of_loop, limit);

              if (res == t_true)
                *evolution_of_loop = add_to_evolution
                  (loop->num,
!                  chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
                   PLUS_EXPR, rhs1);

              else if (res == t_false)
--- 1085,1099 ----
            {
              /* Match an assignment under the form:
                 "a = b + c".  */
+             evol = *evolution_of_loop;
              res = follow_ssa_edge
                (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
!                &evol, limit);

              if (res == t_true)
                *evolution_of_loop = add_to_evolution
                  (loop->num,
!                  chrec_convert (type_rhs, evol, at_stmt),
                   PLUS_EXPR, rhs1);

              else if (res == t_false)


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (19 preceding siblings ...)
  2005-12-06 15:43 ` rakdver at gcc dot gnu dot org
@ 2005-12-06 18:11 ` olh at suse dot de
  2005-12-06 18:47 ` bergner at vnet dot ibm dot com
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: olh at suse dot de @ 2005-12-06 18:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from olh at suse dot de  2005-12-06 18:11 -------
Created an attachment (id=10420)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10420&action=view)
pr25248.patch

This patch fixes it for me.
Let me attach it in a readable form.


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (20 preceding siblings ...)
  2005-12-06 18:11 ` olh at suse dot de
@ 2005-12-06 18:47 ` bergner at vnet dot ibm dot com
  2005-12-06 20:33 ` rakdver at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: bergner at vnet dot ibm dot com @ 2005-12-06 18:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from bergner at vnet dot ibm dot com  2005-12-06 18:47 -------
...and I can verify that the patch fixes the reduced test case.  Thanks!


-- 


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (21 preceding siblings ...)
  2005-12-06 18:47 ` bergner at vnet dot ibm dot com
@ 2005-12-06 20:33 ` rakdver at gcc dot gnu dot org
  2005-12-08  9:34 ` rakdver at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-12-06 20:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from rakdver at gcc dot gnu dot org  2005-12-06 20:33 -------
Patch: http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00454.html


-- 

rakdver at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2005-
                   |                            |12/msg00454.html
           Keywords|                            |patch


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


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

* [Bug middle-end/25248] [4.1/4.2 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (22 preceding siblings ...)
  2005-12-06 20:33 ` rakdver at gcc dot gnu dot org
@ 2005-12-08  9:34 ` rakdver at gcc dot gnu dot org
  2005-12-08 15:11 ` [Bug middle-end/25248] [4.1 " rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-12-08  9:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from rakdver at gcc dot gnu dot org  2005-12-08 09:34 -------
Subject: Bug 25248

Author: rakdver
Date: Thu Dec  8 09:34:26 2005
New Revision: 108225

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108225
Log:
        PR tree-optimization/25248
        * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use
        evolution_of_loop from the failed attempt.  Remove handling
        of MULT_EXPR.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-scalar-evolution.c


-- 


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


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

* [Bug middle-end/25248] [4.1 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (23 preceding siblings ...)
  2005-12-08  9:34 ` rakdver at gcc dot gnu dot org
@ 2005-12-08 15:11 ` rguenth at gcc dot gnu dot org
  2005-12-08 15:44 ` rakdver at gcc dot gnu dot org
  2005-12-08 15:54 ` pinskia at gcc dot gnu dot org
  26 siblings, 0 replies; 28+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-12-08 15:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from rguenth at gcc dot gnu dot org  2005-12-08 15:11 -------
Zdenek, can you please apply to the 4.1 branch, too?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression] 2.6.15-|[4.1 Regression] 2.6.15-rc4
                   |rc4                         |arch/powerpc/mm/hash_utils_6
                   |arch/powerpc/mm/hash_utils_6|4.c miscompiled
                   |4.c miscompiled             |


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


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

* [Bug middle-end/25248] [4.1 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (24 preceding siblings ...)
  2005-12-08 15:11 ` [Bug middle-end/25248] [4.1 " rguenth at gcc dot gnu dot org
@ 2005-12-08 15:44 ` rakdver at gcc dot gnu dot org
  2005-12-08 15:54 ` pinskia at gcc dot gnu dot org
  26 siblings, 0 replies; 28+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2005-12-08 15:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from rakdver at gcc dot gnu dot org  2005-12-08 15:44 -------
Subject: Bug 25248

Author: rakdver
Date: Thu Dec  8 15:44:22 2005
New Revision: 108236

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108236
Log:
        PR tree-optimization/25248
        * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use
        evolution_of_loop from the failed attempt.  Remove handling of
        MULT_EXPR.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/tree-scalar-evolution.c


-- 


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


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

* [Bug middle-end/25248] [4.1 Regression] 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled
  2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
                   ` (25 preceding siblings ...)
  2005-12-08 15:44 ` rakdver at gcc dot gnu dot org
@ 2005-12-08 15:54 ` pinskia at gcc dot gnu dot org
  26 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-12-08 15:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #27 from pinskia at gcc dot gnu dot org  2005-12-08 15:54 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2005-12-08 15:54 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-04  1:32 [Bug c/25248] New: 2.6.15-rc4 arch/powerpc/mm/hash_utils_64.c miscompiled olh at suse dot de
2005-12-04  1:36 ` [Bug c/25248] " olh at suse dot de
2005-12-04  2:19 ` [Bug middle-end/25248] " pinskia at gcc dot gnu dot org
2005-12-04 16:43 ` olh at suse dot de
2005-12-04 18:17 ` olh at suse dot de
2005-12-04 19:24 ` [Bug middle-end/25248] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2005-12-04 20:58 ` olh at suse dot de
2005-12-04 23:17 ` giovannibajo at libero dot it
2005-12-06  1:57 ` bergner at vnet dot ibm dot com
2005-12-06  6:26 ` bergner at vnet dot ibm dot com
2005-12-06  8:38 ` olh at suse dot de
2005-12-06  8:44 ` olh at suse dot de
2005-12-06 13:37 ` rguenth at gcc dot gnu dot org
2005-12-06 13:39 ` rguenth at gcc dot gnu dot org
2005-12-06 13:40 ` bergner at vnet dot ibm dot com
2005-12-06 13:43 ` rguenth at gcc dot gnu dot org
2005-12-06 13:48 ` rguenth at gcc dot gnu dot org
2005-12-06 13:59 ` rguenth at gcc dot gnu dot org
2005-12-06 14:26 ` olh at suse dot de
2005-12-06 15:28 ` rakdver at gcc dot gnu dot org
2005-12-06 15:43 ` rakdver at gcc dot gnu dot org
2005-12-06 18:11 ` olh at suse dot de
2005-12-06 18:47 ` bergner at vnet dot ibm dot com
2005-12-06 20:33 ` rakdver at gcc dot gnu dot org
2005-12-08  9:34 ` rakdver at gcc dot gnu dot org
2005-12-08 15:11 ` [Bug middle-end/25248] [4.1 " rguenth at gcc dot gnu dot org
2005-12-08 15:44 ` rakdver at gcc dot gnu dot org
2005-12-08 15:54 ` pinskia 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).