public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37125] New: possible integer codegen bug
@ 2008-08-15 5:50 regehr at cs dot utah dot edu
2008-08-15 14:34 ` [Bug c/37125] " rguenth at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: regehr at cs dot utah dot edu @ 2008-08-15 5:50 UTC (permalink / raw)
To: gcc-bugs
This is seen using r139123 on Ubuntu Hardy on ia32.
regehr@john-home:~/volatile/tmp6$ current-gcc -fwrapv -O0 small.c -o small
regehr@john-home:~/volatile/tmp6$ ./small
regehr@john-home:~/volatile/tmp6$ current-gcc -fwrapv -O1 small.c -o small
regehr@john-home:~/volatile/tmp6$ ./small
Aborted
regehr@john-home:~/volatile/tmp6$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20080815 (experimental) (GCC)
regehr@john-home:~/volatile/tmp6$ cat small.c
extern void abort (void);
static inline unsigned long int
mod_rhs(const long int rhs)
{
if (rhs == 0) return 1;
return rhs;
}
void func_44 (unsigned int p_45);
void func_44 (unsigned int p_45)
{
if (!((p_45 * -9) % mod_rhs (-9))) {
abort();
}
}
int main (void)
{
func_44 (2);
return 0;
}
--
Summary: possible integer codegen bug
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/37125] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
@ 2008-08-15 14:34 ` rguenth at gcc dot gnu dot org
2008-08-15 14:39 ` [Bug middle-end/37125] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-15 14:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-08-15 14:32 -------
This somehow looks familiar. Also happens on the 4.3 branch.
--
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=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
2008-08-15 14:34 ` [Bug c/37125] " rguenth at gcc dot gnu dot org
@ 2008-08-15 14:39 ` rguenth at gcc dot gnu dot org
2008-08-15 17:22 ` regehr at cs dot utah dot edu
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-15 14:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-08-15 14:37 -------
Probably a dup of PR36548.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c |middle-end
Ever Confirmed|0 |1
Keywords| |wrong-code
Known to fail| |4.3.1
Known to work| |4.2.4
Last reconfirmed|0000-00-00 00:00:00 |2008-08-15 14:37:41
date| |
Summary|possible integer codegen bug|[4.3/4.4 Regression]
| |possible integer codegen bug
Target Milestone|--- |4.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
2008-08-15 14:34 ` [Bug c/37125] " rguenth at gcc dot gnu dot org
2008-08-15 14:39 ` [Bug middle-end/37125] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
@ 2008-08-15 17:22 ` regehr at cs dot utah dot edu
2008-08-18 13:58 ` jsm28 at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: regehr at cs dot utah dot edu @ 2008-08-15 17:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from regehr at cs dot utah dot edu 2008-08-15 17:20 -------
(In reply to comment #2)
> Probably a dup of PR36548.
>
But PR36548 seemed to be about overflow whereas this one doesn't appear to have
any overflows.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (2 preceding siblings ...)
2008-08-15 17:22 ` regehr at cs dot utah dot edu
@ 2008-08-18 13:58 ` jsm28 at gcc dot gnu dot org
2008-08-22 0:33 ` cnstar9988 at gmail dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-08-18 13:58 UTC (permalink / raw)
To: gcc-bugs
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (3 preceding siblings ...)
2008-08-18 13:58 ` jsm28 at gcc dot gnu dot org
@ 2008-08-22 0:33 ` cnstar9988 at gmail dot com
2008-08-22 9:02 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cnstar9988 at gmail dot com @ 2008-08-22 0:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from cnstar9988 at gmail dot com 2008-08-22 00:31 -------
works well on 4.2.4, 4.3.0, 4.3.2-RC1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (4 preceding siblings ...)
2008-08-22 0:33 ` cnstar9988 at gmail dot com
@ 2008-08-22 9:02 ` rguenth at gcc dot gnu dot org
2008-08-22 9:29 ` cnstar9988 at gmail dot com
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-22 9:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-08-22 09:01 -------
It only fails for 32bit targets.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (5 preceding siblings ...)
2008-08-22 9:02 ` rguenth at gcc dot gnu dot org
@ 2008-08-22 9:29 ` cnstar9988 at gmail dot com
2008-08-22 10:35 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cnstar9988 at gmail dot com @ 2008-08-22 9:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from cnstar9988 at gmail dot com 2008-08-22 09:28 -------
sorry, I use 64bit linux for testing.
I tested again.
works well on all 64bit 4.2.4, 4.3.0, 4.3.2-RC1.
works well on 4.2.4 32bit.
works failed on gcc 4.3.0 32bit.
wokrs failed on gcc 4.3.2 RC1 32bit.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (6 preceding siblings ...)
2008-08-22 9:29 ` cnstar9988 at gmail dot com
@ 2008-08-22 10:35 ` rguenth at gcc dot gnu dot org
2008-08-22 12:47 ` rguenth at gcc dot gnu dot org
2008-08-28 14:21 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-22 10:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2008-08-22 10:34 -------
Same issue as PR36548.
*** This bug has been marked as a duplicate of 36548 ***
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (7 preceding siblings ...)
2008-08-22 10:35 ` rguenth at gcc dot gnu dot org
@ 2008-08-22 12:47 ` rguenth at gcc dot gnu dot org
2008-08-28 14:21 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-22 12:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2008-08-22 12:45 -------
Subject: Bug 37125
Author: rguenth
Date: Fri Aug 22 12:43:49 2008
New Revision: 139450
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139450
Log:
2008-08-22 Richard Guenther <rguenther@suse.de>
PR middle-end/36548
PR middle-end/37125
* fold-const.c (extract_muldiv_1): Optimize (X * C1) % C2 only
if the multiplication does not overflow.
* gcc.c-torture/execute/pr37125.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr37125.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug middle-end/37125] [4.3/4.4 Regression] possible integer codegen bug
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
` (8 preceding siblings ...)
2008-08-22 12:47 ` rguenth at gcc dot gnu dot org
@ 2008-08-28 14:21 ` rguenth at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-28 14:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2008-08-28 14:19 -------
Subject: Bug 37125
Author: rguenth
Date: Thu Aug 28 14:18:23 2008
New Revision: 139709
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139709
Log:
2008-08-28 Richard Guenther <rguenther@suse.de>
PR middle-end/36548
PR middle-end/37125
* fold-const.c (extract_muldiv_1): Optimize (X * C1) % C2 only
if the multiplication does not overflow.
* gcc.c-torture/execute/pr37125.c: New testcase.
Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/execute/pr37125.c
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/fold-const.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37125
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-08-28 14:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-15 5:50 [Bug c/37125] New: possible integer codegen bug regehr at cs dot utah dot edu
2008-08-15 14:34 ` [Bug c/37125] " rguenth at gcc dot gnu dot org
2008-08-15 14:39 ` [Bug middle-end/37125] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org
2008-08-15 17:22 ` regehr at cs dot utah dot edu
2008-08-18 13:58 ` jsm28 at gcc dot gnu dot org
2008-08-22 0:33 ` cnstar9988 at gmail dot com
2008-08-22 9:02 ` rguenth at gcc dot gnu dot org
2008-08-22 9:29 ` cnstar9988 at gmail dot com
2008-08-22 10:35 ` rguenth at gcc dot gnu dot org
2008-08-22 12:47 ` rguenth at gcc dot gnu dot org
2008-08-28 14:21 ` rguenth 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).