public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
@ 2008-01-22 0:16 pmarques at grupopie dot com
2008-01-22 0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: pmarques at grupopie dot com @ 2008-01-22 0:16 UTC (permalink / raw)
To: gcc-bugs
This test case fails with latest gcc 4.3.0. The test assumes 32 bit integers,
but even after changing the constants to long, it produces incorrect results.
With -O2 we get this:
int f(unsigned number_of_digits_to_use)
{
if (number_of_digits_to_use > 1294)
206: 65 e0 ldi r22, 0x05 ; 5
208: 8f 30 cpi r24, 0x0F ; 15
20a: 96 07 cpc r25, r22
20c: c0 f4 brcc .+48 ; 0x23e <f+0x38>
return 0;
return ((number_of_digits_to_use * 3321928L) / 1000000L + 1) /16;
20e: bc 01 movw r22, r24
210: 80 e0 ldi r24, 0x00 ; 0
212: 90 e0 ldi r25, 0x00 ; 0
214: 0e 94 6c 06 call 0xcd8 ; 0xcd8 <__mulsi3>
[...]
It "forgets" to load r18:r19:r20:r21 with 3321928 before calling __mulsi3.
--
Summary: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and
-Os
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pmarques at grupopie dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: avr-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
@ 2008-01-22 0:53 ` hutchinsonandy at aim dot com
2008-01-22 0:59 ` hutchinsonandy at aim dot com
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-01-22 0:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hutchinsonandy at aim dot com 2008-01-22 00:23 -------
Created an attachment (id=14991)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14991&action=view)
Combine pass RTL dump file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
2008-01-22 0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
@ 2008-01-22 0:59 ` hutchinsonandy at aim dot com
2008-01-22 1:06 ` hutchinsonandy at aim dot com
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-01-22 0:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from hutchinsonandy at aim dot com 2008-01-22 00:26 -------
Created an attachment (id=14992)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14992&action=view)
dce pass RTL dump file (bfore combine)
Posted two RTL dump file of smaller testcase:
long f2(long number_of_digits_to_use)
{
return ( number_of_digits_to_use * 11L ) ;
}
This faile GCC head 4.3.0 of 13/12/2007
Combine decide load of constant is not needed. Seem to happen after combine
tries combining load with multiply (ie multiply by constant).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
2008-01-22 0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
2008-01-22 0:59 ` hutchinsonandy at aim dot com
@ 2008-01-22 1:06 ` hutchinsonandy at aim dot com
2008-01-23 0:03 ` hutchinsonandy at aim dot com
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-01-22 1:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hutchinsonandy at aim dot com 2008-01-22 00:52 -------
Assembler of short testcase. Constant load (11L) missing
16 .Ltext0:
17 .global f2
19 f2:
20 .LFB2:
21 .LM1:
22 .LVL0:
23 /* prologue: function */
24 /* frame size = 0 */
25 .LM2:
26 0000 0E94 0000 call __mulsi3
27 .LVL1:
28 /* epilogue start */
29 .LM3:
30 0004 0895 ret
31 .LFE2:
57 .Letext0:
DEFINED SYMBOLS
--
hutchinsonandy at aim dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hutchinsonandy at aim dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (2 preceding siblings ...)
2008-01-22 1:06 ` hutchinsonandy at aim dot com
@ 2008-01-23 0:03 ` hutchinsonandy at aim dot com
2008-01-23 5:21 ` [Bug target/34916] [4.3 Regression] " pmarques at grupopie dot com
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-01-23 0:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hutchinsonandy at aim dot com 2008-01-22 23:41 -------
The WRONG CODE is still present on 4.3.0 20080121 HEAD.
This is a regresssion from 4.2 (A big one too!)
4.2.2 20071221 (Winavr) OK
4.3.0 20071213 FAILS
4.3.0 HEAD 20080121 FAILS
vr-gcc -c -mmcu=atmega128 -g -w -Q -O2 -DSTACK_SIZE=400 -da -DNO_TRAMPOLINES
-fno-show-column -DSIGNAL_SUPPRESS -lm -Wa,-adhlns=xpr27364.lst -lm
-std=gnu99 xpr27364.c -o xpr27364.o
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (3 preceding siblings ...)
2008-01-23 0:03 ` hutchinsonandy at aim dot com
@ 2008-01-23 5:21 ` pmarques at grupopie dot com
2008-01-23 19:31 ` manu at gcc dot gnu dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pmarques at grupopie dot com @ 2008-01-23 5:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pmarques at grupopie dot com 2008-01-23 03:31 -------
I just found out another data point: this happens when you pass
-mmcu=atmega128, but not if you pass -mmcu=attiny13 (for instance).
--
pmarques at grupopie dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pmarques at grupopie dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (4 preceding siblings ...)
2008-01-23 5:21 ` [Bug target/34916] [4.3 Regression] " pmarques at grupopie dot com
@ 2008-01-23 19:31 ` manu at gcc dot gnu dot org
2008-01-23 21:25 ` jakub at gcc dot gnu dot org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-01-23 19:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from manu at gcc dot gnu dot org 2008-01-23 18:37 -------
Regressions should have a target milestone
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (5 preceding siblings ...)
2008-01-23 19:31 ` manu at gcc dot gnu dot org
@ 2008-01-23 21:25 ` jakub at gcc dot gnu dot org
2008-03-15 0:44 ` [Bug target/34916] [4.3/4.4 " jsm28 at gcc dot gnu dot org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-23 21:25 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (6 preceding siblings ...)
2008-01-23 21:25 ` jakub at gcc dot gnu dot org
@ 2008-03-15 0:44 ` jsm28 at gcc dot gnu dot org
2008-03-15 23:41 ` hutchinsonandy at aim dot com
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-03-15 0:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jsm28 at gcc dot gnu dot org 2008-03-15 00:42 -------
Update milestone after 4.3.0 release.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.0 |4.3.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (7 preceding siblings ...)
2008-03-15 0:44 ` [Bug target/34916] [4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2008-03-15 23:41 ` hutchinsonandy at aim dot com
2008-04-04 22:35 ` eric dot weddington at atmel dot com
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-03-15 23:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from hutchinsonandy at aim dot com 2008-03-15 23:40 -------
This appear to be same bug where combine is erroneously assuming all DF
register references are to different instructions. So it tries combining
instructions with themselves and stuff gets lost.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35519
The above testcase still fails with gcc version 4.4.0 20080305.
However, with patch from PR35519 it produces correct code:
23 /* prologue: function */
24 /* frame size = 0 */
25 .LM2:
26 0000 2BE0 ldi r18,lo8(11)
27 0002 30E0 ldi r19,hi8(11)
28 0004 40E0 ldi r20,hlo8(11)
29 0006 50E0 ldi r21,hhi8(11)
30 0008 0E94 0000 call __mulsi3
31 .LVL1:
32 /* epilogue start */
33 .LM3:
34 000c 0895 ret
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (8 preceding siblings ...)
2008-03-15 23:41 ` hutchinsonandy at aim dot com
@ 2008-04-04 22:35 ` eric dot weddington at atmel dot com
2008-04-04 23:47 ` hutchinsonandy at gcc dot gnu dot org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: eric dot weddington at atmel dot com @ 2008-04-04 22:35 UTC (permalink / raw)
To: gcc-bugs
--
eric dot weddington at atmel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-04-04 22:34:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (9 preceding siblings ...)
2008-04-04 22:35 ` eric dot weddington at atmel dot com
@ 2008-04-04 23:47 ` hutchinsonandy at gcc dot gnu dot org
2008-04-08 15:17 ` eric dot weddington at atmel dot com
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2008-04-04 23:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from hutchinsonandy at gcc dot gnu dot org 2008-04-04 23:46 -------
Subject: Bug 34916
Author: hutchinsonandy
Date: Fri Apr 4 23:45:46 2008
New Revision: 133920
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133920
Log:
PR rtl-optimization/34916
PR middle-end/35519
* combine.c (create_log_links): Do not create duplicate LOG_LINKS
between instruction pairs
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (10 preceding siblings ...)
2008-04-04 23:47 ` hutchinsonandy at gcc dot gnu dot org
@ 2008-04-08 15:17 ` eric dot weddington at atmel dot com
2008-04-08 17:24 ` hutchinsonandy at aim dot com
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: eric dot weddington at atmel dot com @ 2008-04-08 15:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from eric dot weddington at atmel dot com 2008-04-08 15:16 -------
Andy, since this was a 4.3 regression is there any way we can back port this
and commit it on the 4.3 branch?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (11 preceding siblings ...)
2008-04-08 15:17 ` eric dot weddington at atmel dot com
@ 2008-04-08 17:24 ` hutchinsonandy at aim dot com
2008-04-09 22:52 ` hutchinsonandy at gcc dot gnu dot org
2008-04-12 15:38 ` hutchinsonandy at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at aim dot com @ 2008-04-08 17:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from hutchinsonandy at aim dot com 2008-04-08 17:23 -------
Subject: Re: [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c
fails with -O1, -O2 and -Os
I believe the rules allow for this after a suitable grace period.
Remind me towards end of week and I will post for approval.
Andy
-----Original Message-----
From: eric dot weddington at atmel dot com <gcc-bugzilla@gcc.gnu.org>
To: hutchinsonandy@aim.com
Sent: Tue, 8 Apr 2008 11:16 am
Subject: [Bug target/34916] [4.3/4.4 Regression]
gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
------- Comment #10 from eric dot weddington at atmel dot com
2008-04-08 15:16
-------
Andy, since this was a 4.3 regression is there any way we can back port
this
and commit it on the 4.3 branch?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (12 preceding siblings ...)
2008-04-08 17:24 ` hutchinsonandy at aim dot com
@ 2008-04-09 22:52 ` hutchinsonandy at gcc dot gnu dot org
2008-04-12 15:38 ` hutchinsonandy at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2008-04-09 22:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from hutchinsonandy at gcc dot gnu dot org 2008-04-09 22:51 -------
Subject: Bug 34916
Author: hutchinsonandy
Date: Wed Apr 9 22:50:42 2008
New Revision: 134152
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134152
Log:
2008-04-09 Andy Hutchinson <hutchinsonandy@aim.com>
PR rtl-optimization/34916
PR middle-end/35519
* combine.c (create_log_links): Do not create duplicate LOG_LINKS
between instruction pairs
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/combine.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/34916] [4.3/4.4 Regression] gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
` (13 preceding siblings ...)
2008-04-09 22:52 ` hutchinsonandy at gcc dot gnu dot org
@ 2008-04-12 15:38 ` hutchinsonandy at gcc dot gnu dot org
14 siblings, 0 replies; 16+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2008-04-12 15:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from hutchinsonandy at gcc dot gnu dot org 2008-04-12 15:38 -------
Fixed 4.3 and 4.4
--
hutchinsonandy at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34916
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2008-04-12 15:38 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-22 0:16 [Bug target/34916] New: gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os pmarques at grupopie dot com
2008-01-22 0:53 ` [Bug target/34916] " hutchinsonandy at aim dot com
2008-01-22 0:59 ` hutchinsonandy at aim dot com
2008-01-22 1:06 ` hutchinsonandy at aim dot com
2008-01-23 0:03 ` hutchinsonandy at aim dot com
2008-01-23 5:21 ` [Bug target/34916] [4.3 Regression] " pmarques at grupopie dot com
2008-01-23 19:31 ` manu at gcc dot gnu dot org
2008-01-23 21:25 ` jakub at gcc dot gnu dot org
2008-03-15 0:44 ` [Bug target/34916] [4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-03-15 23:41 ` hutchinsonandy at aim dot com
2008-04-04 22:35 ` eric dot weddington at atmel dot com
2008-04-04 23:47 ` hutchinsonandy at gcc dot gnu dot org
2008-04-08 15:17 ` eric dot weddington at atmel dot com
2008-04-08 17:24 ` hutchinsonandy at aim dot com
2008-04-09 22:52 ` hutchinsonandy at gcc dot gnu dot org
2008-04-12 15:38 ` hutchinsonandy 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).