This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37125] New: possible integer codegen bug
- From: "regehr at cs dot utah dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Aug 2008 05:48:53 -0000
- Subject: [Bug c/37125] New: possible integer codegen bug
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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