* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
@ 2012-07-02 8:52 ` rguenth at gcc dot gnu.org
2012-07-11 10:51 ` danglin at gcc dot gnu.org
` (24 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 8:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
2012-07-02 8:52 ` [Bug middle-end/53823] " rguenth at gcc dot gnu.org
@ 2012-07-11 10:51 ` danglin at gcc dot gnu.org
2012-07-12 1:43 ` danglin at gcc dot gnu.org
` (23 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-11 10:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rth at gcc dot gnu.org
--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-11 10:50:57 UTC ---
Introduced in revision 188786.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
2012-07-02 8:52 ` [Bug middle-end/53823] " rguenth at gcc dot gnu.org
2012-07-11 10:51 ` danglin at gcc dot gnu.org
@ 2012-07-12 1:43 ` danglin at gcc dot gnu.org
2012-07-27 18:20 ` danglin at gcc dot gnu.org
` (22 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-12 1:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-12 01:43:11 UTC ---
This hunk of RTL was generated in .expand for function f:
;; D.1356_3 = D.1355_2 * 2863311531;
(insn 9 8 10 (set (reg:SI 104)
(subreg:SI (reg:DI 96 [ D.1355 ]) 4))
/test/gnu/gcc/gcc/gcc/testsuite/gc
c.c-torture/execute/930921-1.c:4 -1
(nil))
(insn 10 9 11 (set (subreg:SI (reg:DI 97 [ D.1356 ]) 0)
(ashift:SI (reg:SI 104)
(const_int 31 [0x1f])))
/test/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/930921-1.c:4 -1
(expr_list:REG_EQUAL (ashift:SI (subreg:SI (reg:DI 96 [ D.1355 ]) 4)
(const_int 31 [0x1f]))
(nil)))
(insn 11 10 0 (set (subreg:SI (reg:DI 97 [ D.1356 ]) 4)
(const_int 0 [0]))
/test/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/930921-1.c:4 -1
(nil))
Looks wrong to me. Fails when x=1.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (2 preceding siblings ...)
2012-07-12 1:43 ` danglin at gcc dot gnu.org
@ 2012-07-27 18:20 ` danglin at gcc dot gnu.org
2012-07-29 16:31 ` danglin at gcc dot gnu.org
` (21 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-27 18:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #3 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-27 18:19:26 UTC ---
*** Bug 53974 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (3 preceding siblings ...)
2012-07-27 18:20 ` danglin at gcc dot gnu.org
@ 2012-07-29 16:31 ` danglin at gcc dot gnu.org
2012-07-30 13:31 ` rth at gcc dot gnu.org
` (20 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-29 16:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-29 16:31:22 UTC ---
Created attachment 27888
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27888
Patch
Fixes 930921-1.c and four original acats fails, but not
additional acats fails introduced in 189441.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (4 preceding siblings ...)
2012-07-29 16:31 ` danglin at gcc dot gnu.org
@ 2012-07-30 13:31 ` rth at gcc dot gnu.org
2012-07-30 14:13 ` steven at gcc dot gnu.org
` (19 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: rth at gcc dot gnu.org @ 2012-07-30 13:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
Richard Henderson <rth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-07-30
Ever Confirmed|0 |1
--- Comment #5 from Richard Henderson <rth at gcc dot gnu.org> 2012-07-30 13:31:15 UTC ---
That patch is obviously correct.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (5 preceding siblings ...)
2012-07-30 13:31 ` rth at gcc dot gnu.org
@ 2012-07-30 14:13 ` steven at gcc dot gnu.org
2012-07-30 14:26 ` ubizjak at gmail dot com
` (18 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: steven at gcc dot gnu.org @ 2012-07-30 14:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |uros at gcc dot gnu.org
--- Comment #6 from Steven Bosscher <steven at gcc dot gnu.org> 2012-07-30 14:13:04 UTC ---
And this is why "uninitialized" warnings shouldn't be silenced like this...
* expmed.c (expand_mult): Initialize coeff and is_neg.
http://gcc.gnu.org/viewcvs?view=revision&revision=189281
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (6 preceding siblings ...)
2012-07-30 14:13 ` steven at gcc dot gnu.org
@ 2012-07-30 14:26 ` ubizjak at gmail dot com
2012-07-30 15:46 ` danglin at gcc dot gnu.org
` (17 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: ubizjak at gmail dot com @ 2012-07-30 14:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #7 from Uros Bizjak <ubizjak at gmail dot com> 2012-07-30 14:25:32 UTC ---
(In reply to comment #6)
> And this is why "uninitialized" warnings shouldn't be silenced like this...
>
> * expmed.c (expand_mult): Initialize coeff and is_neg.
>
> http://gcc.gnu.org/viewcvs?view=revision&revision=189281
Sure, considering that following is way better:
# These files are to have specific diagnostics suppressed, or are not to
# be subject to -Werror:
# flex output may yield harmless "no previous prototype" warnings
build/gengtype-lex.o-warn = -Wno-error
gengtype-lex.o-warn = -Wno-error
expmed.o-warn = -Wno-error
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (7 preceding siblings ...)
2012-07-30 14:26 ` ubizjak at gmail dot com
@ 2012-07-30 15:46 ` danglin at gcc dot gnu.org
2012-07-31 18:51 ` danglin at gcc dot gnu.org
` (16 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-30 15:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #8 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-30 15:46:13 UTC ---
Author: danglin
Date: Mon Jul 30 15:46:08 2012
New Revision: 189980
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189980
Log:
PR middle-end/53823
* expmed.c (expand_mult): Skip synth_mult for constant double op1 except
for special cases. Don't initialize coeff and is_neg.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expmed.c
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (8 preceding siblings ...)
2012-07-30 15:46 ` danglin at gcc dot gnu.org
@ 2012-07-31 18:51 ` danglin at gcc dot gnu.org
2012-07-31 19:41 ` danglin at gcc dot gnu.org
` (15 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-31 18:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #9 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-31 18:51:26 UTC ---
Regarding the remaining acats fails, the following line in a-calend.adb
appears to be miscompiled:
Date_Dur := Date_Dur - Time_Dur (Four_Year_Segs) *
Secs_In_Four_Years;
The resulting value for Date_Dur is wrong.
The generated code appears to use synth_mult.
=> 0x00019c28 <__gnat_split+480>: cmpib,>= 0,ret1,0x19cd0 <__gnat_split+648>
0x00019c2c <__gnat_split+484>: copy ret1,r20
0x00019c30 <__gnat_split+488>: ldi 0,r21
0x00019c34 <__gnat_split+492>: ldi -1,r22
0x00019c38 <__gnat_split+496>: and r19,r21,ret0
0x00019c3c <__gnat_split+500>: and r20,r22,ret1
0x00019c40 <__gnat_split+504>: extrw,u ret1,4,5,r19
0x00019c44 <__gnat_split+508>: depw,z ret0,26,27,r7
0x00019c48 <__gnat_split+512>: depw,z ret1,26,27,r8
0x00019c4c <__gnat_split+516>: or r19,r7,r7
0x00019c50 <__gnat_split+520>: sub r8,ret1,r12
0x00019c54 <__gnat_split+524>: sub,b r7,ret0,r11
0x00019c58 <__gnat_split+528>: extrw,u r12,8,9,r31
0x00019c5c <__gnat_split+532>: depw,z r12,22,23,r26
0x00019c60 <__gnat_split+536>: depw,z r11,22,23,r25
0x00019c64 <__gnat_split+540>: or r31,r25,r25
0x00019c68 <__gnat_split+544>: add r26,r12,r8
0x00019c6c <__gnat_split+548>: add,c r25,r11,r7
0x00019c70 <__gnat_split+552>: extrw,u r8,0,1,r31
0x00019c74 <__gnat_split+556>: depw,z r8,30,31,r24
0x00019c78 <__gnat_split+560>: depw,z r7,30,31,r23
0x00019c7c <__gnat_split+564>: or r31,r23,r23
0x00019c80 <__gnat_split+568>: sub r24,ret1,r26
0x00019c84 <__gnat_split+572>: sub,b r23,ret0,r25
0x00019c88 <__gnat_split+576>: extrw,u r26,3,4,r31
0x00019c8c <__gnat_split+580>: depw,z r25,27,28,r21
0x00019c90 <__gnat_split+584>: or r31,r21,r21
0x00019c94 <__gnat_split+588>: depw,z r26,27,28,r22
0x00019c98 <__gnat_split+592>: sub r22,ret1,r24
0x00019c9c <__gnat_split+596>: sub,b r21,ret0,r23
0x00019ca0 <__gnat_split+600>: extrw,u r24,5,6,r21
0x00019ca4 <__gnat_split+604>: depw,z r23,25,26,r19
0x00019ca8 <__gnat_split+608>: depw,z r24,25,26,r20
0x00019cac <__gnat_split+612>: or r21,r19,r19
0x00019cb0 <__gnat_split+616>: add ret1,r20,r22
0x00019cb4 <__gnat_split+620>: add,c ret0,r19,r21
0x00019cb8 <__gnat_split+624>: shrpw r21,r22,25,r19
0x00019cbc <__gnat_split+628>: depw,z r22,24,25,ret0
0x00019cc0 <__gnat_split+632>: copy r19,r21
0x00019cc4 <__gnat_split+636>: copy ret0,r22
0x00019cc8 <__gnat_split+640>: add r22,r4,r8
0x00019ccc <__gnat_split+644>: add,c r21,r3,r7
0x00019cd0 <__gnat_split+648>: copy r7,r25
0x00019cd4 <__gnat_split+652>: copy r8,r26
0x00019cd8 <__gnat_split+656>: ldi 0,r23
0x00019cdc <__gnat_split+660>: ldil L%1e13000,r24
0x00019ce0 <__gnat_split+664>: ldo 380(r24),r24
0x00019ce4 <__gnat_split+668>: b,l 0x34288 <__divdi3>,rp
0x00019ce8 <__gnat_split+672>: nop
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (9 preceding siblings ...)
2012-07-31 18:51 ` danglin at gcc dot gnu.org
@ 2012-07-31 19:41 ` danglin at gcc dot gnu.org
2012-07-31 19:59 ` rth at gcc dot gnu.org
` (14 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-07-31 19:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #10 from John David Anglin <danglin at gcc dot gnu.org> 2012-07-31 19:41:20 UTC ---
Created attachment 27913
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27913
Testcase
Testcase produces wrong output when compiled at -O0 and -O1.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (10 preceding siblings ...)
2012-07-31 19:41 ` danglin at gcc dot gnu.org
@ 2012-07-31 19:59 ` rth at gcc dot gnu.org
2012-07-31 20:11 ` dave.anglin at bell dot net
` (13 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: rth at gcc dot gnu.org @ 2012-07-31 19:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
Richard Henderson <rth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |rth at gcc dot gnu.org
|gnu.org |
--- Comment #11 from Richard Henderson <rth at gcc dot gnu.org> 2012-07-31 19:58:49 UTC ---
Mine.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (11 preceding siblings ...)
2012-07-31 19:59 ` rth at gcc dot gnu.org
@ 2012-07-31 20:11 ` dave.anglin at bell dot net
2012-07-31 21:30 ` rth at gcc dot gnu.org
` (12 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: dave.anglin at bell dot net @ 2012-07-31 20:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #12 from dave.anglin at bell dot net 2012-07-31 20:10:55 UTC ---
> Mine.
Expected result for testcase is 112975202 (0x6bbdd62). Miscompiled
result is
116077092194 (0x1b06bbdd62).
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (12 preceding siblings ...)
2012-07-31 20:11 ` dave.anglin at bell dot net
@ 2012-07-31 21:30 ` rth at gcc dot gnu.org
2012-07-31 22:55 ` dave.anglin at bell dot net
` (11 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: rth at gcc dot gnu.org @ 2012-07-31 21:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #13 from Richard Henderson <rth at gcc dot gnu.org> 2012-07-31 21:29:52 UTC ---
Created attachment 27914
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27914
Cross-compile output
Hmm. I can't seem to reproduce this via a cross-compiler.
I tried CC='gcc -m32' of hppa-linux, so as to get the same
behavior wrt HOST_BITS_PER_WIDE_INT as your native bootstrap.
I compared the output on the testcase with mainline and 4.7
and they come out identical.
How does this -O1 output compare with native?
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (13 preceding siblings ...)
2012-07-31 21:30 ` rth at gcc dot gnu.org
@ 2012-07-31 22:55 ` dave.anglin at bell dot net
2012-07-31 22:56 ` dave.anglin at bell dot net
` (10 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: dave.anglin at bell dot net @ 2012-07-31 22:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #14 from dave.anglin at bell dot net 2012-07-31 22:54:59 UTC ---
On 31-Jul-12, at 5:29 PM, rth at gcc dot gnu.org wrote:
> How does this -O1 output compare with native?
There seems to an off by one error in various shifts, etc. For
example,
;(insn 8 4 10 (set (reg:SI 19 %r19 [104])
; (lshiftrt:SI (reg:SI 24 %r24 [orig:100 y+4 ] [100])
; (const_int 27 [0x1b]))) xxx.c:5 179 {lshrsi3}
; (nil))
extru %r24,4,5,%r19 ; 8 lshrsi3/2 [length = 4]
With 4.6, I see something similar to what you see:
;(insn 8 62 10 (set (reg:SI 20 %r20 [104])
; (lshiftrt:SI (reg:SI 24 %r24 [orig:136+4 ] [136])
; (const_int 28 [0x1c]))) xxx.c:5 178 {lshrsi3}
; (nil))
extru %r24,3,4,%r20 ; 8 lshrsi3/2 [length = 4]
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (14 preceding siblings ...)
2012-07-31 22:55 ` dave.anglin at bell dot net
@ 2012-07-31 22:56 ` dave.anglin at bell dot net
2012-08-01 0:31 ` danglin at gcc dot gnu.org
` (9 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: dave.anglin at bell dot net @ 2012-07-31 22:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #15 from dave.anglin at bell dot net 2012-07-31 22:55:54 UTC ---
Created attachment 27916
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27916
zz.s.txt
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (15 preceding siblings ...)
2012-07-31 22:56 ` dave.anglin at bell dot net
@ 2012-08-01 0:31 ` danglin at gcc dot gnu.org
2012-08-01 0:41 ` danglin at gcc dot gnu.org
` (8 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-01 0:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
--- Comment #16 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-01 00:30:40 UTC ---
The first shift amount seems to come from this statement
in expand_mult_const:
int log = alg->log[opno];
The algorithm choice seems cost related, so it's starting
to make a bit of sense that this broke in 189441.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (16 preceding siblings ...)
2012-08-01 0:31 ` danglin at gcc dot gnu.org
@ 2012-08-01 0:41 ` danglin at gcc dot gnu.org
2012-08-01 2:25 ` rth at gcc dot gnu.org
` (7 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-01 0:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #17 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-01 00:40:24 UTC ---
(gdb) p *(const struct algorithm *)$r17
$21 = {cost = {cost = 24, latency = 24}, ops = 7, op = {alg_m, alg_sub_t2_m,
alg_add_factor, alg_sub_t2_m, alg_sub_t2_m, alg_add_t2_m, alg_shift,
2622983, alg_unknown, 28, alg_unknown, alg_unknown, 4226821568, 9510444,
786444, alg_unknown, 4226821456, alg_add_t_m2, alg_m, alg_add_t_m2,
4226822048, 10689160, alg_add_t_m2, 2748287, 10691300, 4226821664, 32,
alg_sub_factor, 1079796408, alg_unknown, 24, alg_unknown, 1079821632,
alg_unknown, alg_unknown, alg_unknown, alg_unknown, 1080629840,
1080642416, alg_unknown, 4226822232, alg_unknown, 1080629840, 1080642416,
alg_unknown, 1080672448, 1080128768, 1080642600, 378, 9959428,
alg_unknown, alg_zero, 1079744120, alg_zero, 3709487, 2873783, 27157688,
alg_unknown, 9704808, alg_unknown, 1079796408, alg_unknown, alg_unknown,
alg_unknown},
log =
"\000\005\t\001\004\006\a0\000\000\000\b\000\227\370\004\373\360\060X\000\000\000\000@i\032P@iKp\000\000\000\000\000\247\332\370@\\\305@\000\252>\270@iL\030@iL\030@au\000@iLH"}
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (17 preceding siblings ...)
2012-08-01 0:41 ` danglin at gcc dot gnu.org
@ 2012-08-01 2:25 ` rth at gcc dot gnu.org
2012-08-01 14:21 ` dave.anglin at bell dot net
` (6 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: rth at gcc dot gnu.org @ 2012-08-01 2:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #18 from Richard Henderson <rth at gcc dot gnu.org> 2012-08-01 02:25:03 UTC ---
But this is what you get when cross-compiling from i686.
3267 rtx temp = expand_mult_const (mode, op0, -coeff, NULL_RTX,
(gdb) p algorithm
$1 = {cost = {cost = 24, latency = 24}, ops = 7, op = {alg_m, alg_add_t2_m,
alg_add_t2_m, alg_sub_t2_m, alg_sub_factor, alg_sub_factor, alg_shift,
4155963284, alg_unknown, 24, 4155924580, 144092293, 24, alg_unknown,
4294942376, 140383036, 4156006400, 167772184, 4294942392, 144092338,
148964452, 24, 4294942408, 140385161, 4156006400, 1180628613, 4155438304,
4155963284, 4155963284, 4155438304, 4155896864, 4155896864, alg_unknown,
alg_unknown, alg_unknown, alg_unknown, alg_unknown, 4155967104,
4155543416, 140385398, alg_zero, 167772160, 4294942616, 149524616,
alg_unknown, alg_unknown, 4294942552, 137729793, 4155963284, alg_unknown,
alg_unknown, alg_unknown, alg_unknown, 4155963284, 4155896864, 4155896864,
4155896864, 4155896864, 4155438304, 4155963284, 4155963284, 4155963284,
4155963284, 4155543416},
log =
"\000\004\003\005\004\004\a\367\210\237\377\377\273\227\063\b\224\367\266\367",
'\000' <repeats 16 times>,
"\001\000\000\000\001\000\000\000\000\000\000\000\210\220\351\b\000\000\000\000ȟ\377\377\342y5\b"}
(We really ought to zero the structure first just to help debug.
But log[0] and op/log past [ops] are unused and uninitialized.)
The cross-compile *ought* not to affect costs, which means that
we ought to be making the same algorithm choices. Which suggests
that -- if this is a fully bootstrapped pa compiler -- you're
looking at some part of expand_mult itself being mis-compiled.
I'm going to start a build on gcc61, but even checking out the
tree there has taken all day long...
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (18 preceding siblings ...)
2012-08-01 2:25 ` rth at gcc dot gnu.org
@ 2012-08-01 14:21 ` dave.anglin at bell dot net
2012-08-01 14:27 ` dave.anglin at bell dot net
` (5 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: dave.anglin at bell dot net @ 2012-08-01 14:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #19 from dave.anglin at bell dot net 2012-08-01 14:20:49 UTC ---
On 31-Jul-12, at 10:25 PM, rth at gcc dot gnu.org wrote:
> The cross-compile *ought* not to affect costs, which means that
> we ought to be making the same algorithm choices. Which suggests
> that -- if this is a fully bootstrapped pa compiler -- you're
> looking at some part of expand_mult itself being mis-compiled.
I was afraid this might be the case. However, I built a non bootstrap
compiler this morning with -g -O1. The testcase still fails at -O0 and
O1, and works at -O2.
The compiler was configured as follows:
dave@mx3210:~/gnu/gcc/objdir/gcc$ ./xgcc -B./ -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: hppa-linux-gnu
Configured with: ../gcc/configure --with-gnu-as --with-gnu-ld --enable-
shared --enable-multiarch --with-multiarch-defaults=hppa-linux-gnu --
enable-linker-build-id --build=hppa-linux-gnu --host=hppa-linux-gnu --
target=hppa-linux-gnu --prefix=/home/dave/opt/gnu/gcc/gcc-4.7.0 --with-
local-prefix=/home/dave/opt/gnu --enable-threads=posix --enable-
__cxa_atexit --build=hppa-linux-gnu --enable-clocale=gnu --enable-java-
gc=boehm --enable-languages=c --disable-bootstrap
Thread model: posix
gcc version 4.8.0 20120801 (experimental) [trunk revision 190037] (GCC)
You probably would need to add --with-arch=1.1 to duplicate the
default native settings with a cross.
The difference in extracts and deposits may not be the problem. The -
O2 code appears to have the same extracts as the
-O1 code. I'll see if I can find where the real difference arises.
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (19 preceding siblings ...)
2012-08-01 14:21 ` dave.anglin at bell dot net
@ 2012-08-01 14:27 ` dave.anglin at bell dot net
2012-08-01 18:44 ` danglin at gcc dot gnu.org
` (4 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: dave.anglin at bell dot net @ 2012-08-01 14:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #20 from dave.anglin at bell dot net 2012-08-01 14:27:30 UTC ---
On 1-Aug-12, at 10:20 AM, dave.anglin at bell dot net wrote:
> The difference in extracts and deposits may not be the problem. The -
> O2 code appears to have the same extracts as the
> -O1 code. I'll see if I can find where the real difference arises.
Doh, the correct result is inlined at -O2. foo is still mis-compiled.
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (20 preceding siblings ...)
2012-08-01 14:27 ` dave.anglin at bell dot net
@ 2012-08-01 18:44 ` danglin at gcc dot gnu.org
2012-08-12 14:30 ` danglin at gcc dot gnu.org
` (3 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-01 18:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #21 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-01 18:44:04 UTC ---
The issue is with the handling of negative constants.
In this bit of code,
max_cost = (set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), speed)
- neg_cost(speed, mode));
if (max_cost > 0
&& choose_mult_variant (mode, -coeff, &algorithm,
&variant, max_cost))
max_cost is computed to be 24 and choose_mult_variant returns 0. This
causes the following hunk to be executed:
max_cost = set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), speed);
if (choose_mult_variant (mode, coeff, &algorithm, &variant, max_cost))
return expand_mult_const (mode, op0, coeff, target,
&algorithm, variant);
max_cost is now 32 and choose_mult_variant succeeds. However,
expand_mult_const
generates incorrect code when coeff is negative.
I hacked the max_cost in the negative case to be 32, and this produces
the correct result and code similar to your cross-compiled output.
If I remember correctly, the xmpyu instruction was introduced in PA 1.1
and this results in different costs for PA 1.0 and 1.1.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (21 preceding siblings ...)
2012-08-01 18:44 ` danglin at gcc dot gnu.org
@ 2012-08-12 14:30 ` danglin at gcc dot gnu.org
2012-08-13 15:51 ` rth at gcc dot gnu.org
` (2 subsequent siblings)
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-12 14:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #22 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-12 14:30:12 UTC ---
Created attachment 27994
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27994
Patch
/* synth_mult does an `unsigned int' multiply. As long as the mode is
less than or equal in size to `unsigned int' this doesn't matter.
If the mode is larger than `unsigned int', then synth_mult works
only if the constant value exactly fits in an `unsigned int' without
any truncation. This means that multiplying by negative values does
not work; results are off by 2^32 on a 32 bit machine. */
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (22 preceding siblings ...)
2012-08-12 14:30 ` danglin at gcc dot gnu.org
@ 2012-08-13 15:51 ` rth at gcc dot gnu.org
2012-08-18 23:17 ` danglin at gcc dot gnu.org
2012-08-18 23:33 ` danglin at gcc dot gnu.org
25 siblings, 0 replies; 27+ messages in thread
From: rth at gcc dot gnu.org @ 2012-08-13 15:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #23 from Richard Henderson <rth at gcc dot gnu.org> 2012-08-13 15:51:37 UTC ---
On 08/12/2012 07:30 AM, danglin at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
>
> --- Comment #22 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-12 14:30:12 UTC ---
> Created attachment 27994
> --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27994
Ok.
r~
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (23 preceding siblings ...)
2012-08-13 15:51 ` rth at gcc dot gnu.org
@ 2012-08-18 23:17 ` danglin at gcc dot gnu.org
2012-08-18 23:33 ` danglin at gcc dot gnu.org
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-18 23:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
--- Comment #24 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-18 23:16:57 UTC ---
Author: danglin
Date: Sat Aug 18 23:16:53 2012
New Revision: 190505
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190505
Log:
PR middle-end/53823
* expmed.c (expand_mult): Skip synth_mult for negative coefficients
if the mode is larger than a wide int and it is too costly to multiply
by a positive multiplier and negate the result.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/expmed.c
^ permalink raw reply [flat|nested] 27+ messages in thread
* [Bug middle-end/53823] [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1
2012-06-30 19:19 [Bug middle-end/53823] New: [4.8 Regression] FAIL: gcc.c-torture/execute/930921-1.c execution at -O0 and -O1 danglin at gcc dot gnu.org
` (24 preceding siblings ...)
2012-08-18 23:17 ` danglin at gcc dot gnu.org
@ 2012-08-18 23:33 ` danglin at gcc dot gnu.org
25 siblings, 0 replies; 27+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-08-18 23:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53823
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #25 from John David Anglin <danglin at gcc dot gnu.org> 2012-08-18 23:32:37 UTC ---
Although I've got another multiplication issue to resolve, it
was not introduced by the rearrangment of expand_mult. So, I'm going
to start a new PR.
^ permalink raw reply [flat|nested] 27+ messages in thread