public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1
@ 2008-03-11 15:12 r dot schuerer at gmx dot at
2008-03-11 15:13 ` [Bug c/35540] " r dot schuerer at gmx dot at
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: r dot schuerer at gmx dot at @ 2008-03-11 15:12 UTC (permalink / raw)
To: gcc-bugs
Consider the following C-Program main.c:
/*********************************************/
int f (unsigned* a, int b)
{
return b ? 1 : __builtin_parity(*a);
}
int main()
{
unsigned a = 0;
return f(&a, 0);
}
/*********************************************/
Using GCC 4.3.0:
$ /usr/local/gcc-4.3.0/bin/gcc-4.3.0 -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.3.0/configure --prefix=/usr/local/gcc-4.3.0
--program-suffix=-4.3.0 --with-mpfr=/usr/local/ --with-tune=pentium4
--with-arch=pentium4 --enable-languages=c,c++,fortran,java,objc
Thread model: posix
gcc version 4.3.0 (GCC)
When compliled with -O0, the program runs successfully:
$ /usr/local/gcc-4.3.0/bin/gcc-4.3.0 -O0 main.c
$ ./a.out
When complied with -O1, the program segfaults.
$ /usr/local/gcc-4.3.0/bin/gcc-4.3.0 -O1 main.c
$ ./a.out
Segmentation fault
The program runs successfully when compiled with -O2 or -O3.
The program runs successfully with GCC 4.2.3 in all optimization levels.
--
Summary: Segmentation fault with __builtin_parity() and -O1
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r dot schuerer at gmx dot at
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=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/35540] Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
@ 2008-03-11 15:13 ` r dot schuerer at gmx dot at
2008-03-11 15:24 ` r dot schuerer at gmx dot at
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: r dot schuerer at gmx dot at @ 2008-03-11 15:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from r dot schuerer at gmx dot at 2008-03-11 15:13 -------
Created an attachment (id=15297)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15297&action=view)
The C source file triggering the bug
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/35540] Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
2008-03-11 15:13 ` [Bug c/35540] " r dot schuerer at gmx dot at
@ 2008-03-11 15:24 ` r dot schuerer at gmx dot at
2008-03-11 15:36 ` [Bug target/35540] [4.3/4.4 Regression]: " hjl dot tools at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: r dot schuerer at gmx dot at @ 2008-03-11 15:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from r dot schuerer at gmx dot at 2008-03-11 15:23 -------
The assembler code for f() (as listed by "objdump -d a.out") is as follows:
0804838c <f>:
804838c: 55 push %ebp
804838d: 89 e5 mov %esp,%ebp
804838f: b8 01 00 00 00 mov $0x1,%eax
8048394: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
8048398: 75 12 jne 80483ac <f+0x20>
804839a: 8b 45 08 mov 0x8(%ebp),%eax
804839d: 0f b7 40 02 movzwl 0x2(%eax),%eax
80483a1: 66 33 00 xor (%eax),%ax
80483a4: 30 e0 xor %ah,%al
80483a6: 0f 9b c0 setnp %al
80483a9: 0f b6 c0 movzbl %al,%eax
80483ac: 5d pop %ebp
80483ad: c3 ret
GDB says that:
Program received signal SIGSEGV, Segmentation fault.
0x080483a1 in f ()
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
2008-03-11 15:13 ` [Bug c/35540] " r dot schuerer at gmx dot at
2008-03-11 15:24 ` r dot schuerer at gmx dot at
@ 2008-03-11 15:36 ` hjl dot tools at gmail dot com
2008-03-11 15:44 ` ubizjak at gmail dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-03-11 15:36 UTC (permalink / raw)
To: gcc-bugs
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl dot tools at gmail dot
| |com
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Known to fail|4.3.0 |4.3.0 4.4.0
Last reconfirmed|0000-00-00 00:00:00 |2008-03-11 15:35:58
date| |
Summary|Segmentation fault with |[4.3/4.4 Regression]:
|__builtin_parity() and -O1 |Segmentation fault with
| |__builtin_parity() and -O1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (2 preceding siblings ...)
2008-03-11 15:36 ` [Bug target/35540] [4.3/4.4 Regression]: " hjl dot tools at gmail dot com
@ 2008-03-11 15:44 ` ubizjak at gmail dot com
2008-03-11 15:53 ` hjl dot tools at gmail dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2008-03-11 15:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ubizjak at gmail dot com 2008-03-11 15:43 -------
Mine.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ubizjak at gmail dot com
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2008-03-11 15:35:58 |2008-03-11 15:43:20
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (3 preceding siblings ...)
2008-03-11 15:44 ` ubizjak at gmail dot com
@ 2008-03-11 15:53 ` hjl dot tools at gmail dot com
2008-03-11 19:20 ` uros at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-03-11 15:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from hjl dot tools at gmail dot com 2008-03-11 15:53 -------
It was introduced between revisions 121818 and 122326.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (4 preceding siblings ...)
2008-03-11 15:53 ` hjl dot tools at gmail dot com
@ 2008-03-11 19:20 ` uros at gcc dot gnu dot org
2008-03-12 6:38 ` uros at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2008-03-11 19:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from uros at gcc dot gnu dot org 2008-03-11 19:19 -------
Subject: Bug 35540
Author: uros
Date: Tue Mar 11 19:18:48 2008
New Revision: 133118
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133118
Log:
PR target/35540
* config/i386/i386.md (paritysi2, paritydi2): Use register_operand
constraint for operand 1.
(paritysi2_cmp): Use register_operand constraint for operand 2.
Use earlyclobber modifier for operand 1. Remove support for
memory operands.
(paritydi2_cmp): Use register_operand constraint for operand 3.
Use earlyclobber modifier for operand 1. Remove support for
memory operands.
testsuite/ChangeLog:
PR target/35540
* gcc.target/i386/pr35540.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr35540.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.md
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (5 preceding siblings ...)
2008-03-11 19:20 ` uros at gcc dot gnu dot org
@ 2008-03-12 6:38 ` uros at gcc dot gnu dot org
2008-03-12 6:42 ` ubizjak at gmail dot com
2008-03-12 6:43 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2008-03-12 6:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from uros at gcc dot gnu dot org 2008-03-12 06:37 -------
Subject: Bug 35540
Author: uros
Date: Wed Mar 12 06:37:10 2008
New Revision: 133135
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133135
Log:
PR target/35540
* config/i386/i386.md (paritysi2, paritydi2): Use register_operand
constraint for operand 1.
(paritysi2_cmp): Use register_operand constraint for operand 2.
Use earlyclobber modifier for operand 1. Remove support for
memory operands.
(paritydi2_cmp): Use register_operand constraint for operand 3.
Use earlyclobber modifier for operand 1. Remove support for
memory operands.
testsuite/ChangeLog:
PR target/35540
* gcc.target/i386/pr35540.c: New test.
Added:
branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr35540.c
- copied unchanged from r133118,
trunk/gcc/testsuite/gcc.target/i386/pr35540.c
Modified:
branches/gcc-4_3-branch/gcc/ChangeLog
branches/gcc-4_3-branch/gcc/config/i386/i386.md
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (6 preceding siblings ...)
2008-03-12 6:38 ` uros at gcc dot gnu dot org
@ 2008-03-12 6:42 ` ubizjak at gmail dot com
2008-03-12 6:43 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2008-03-12 6:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ubizjak at gmail dot com 2008-03-12 06:42 -------
Fixed.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/35540] [4.3/4.4 Regression]: Segmentation fault with __builtin_parity() and -O1
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
` (7 preceding siblings ...)
2008-03-12 6:42 ` ubizjak at gmail dot com
@ 2008-03-12 6:43 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2008-03-12 6:43 UTC (permalink / raw)
To: gcc-bugs
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35540
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-03-12 6:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-11 15:12 [Bug c/35540] New: Segmentation fault with __builtin_parity() and -O1 r dot schuerer at gmx dot at
2008-03-11 15:13 ` [Bug c/35540] " r dot schuerer at gmx dot at
2008-03-11 15:24 ` r dot schuerer at gmx dot at
2008-03-11 15:36 ` [Bug target/35540] [4.3/4.4 Regression]: " hjl dot tools at gmail dot com
2008-03-11 15:44 ` ubizjak at gmail dot com
2008-03-11 15:53 ` hjl dot tools at gmail dot com
2008-03-11 19:20 ` uros at gcc dot gnu dot org
2008-03-12 6:38 ` uros at gcc dot gnu dot org
2008-03-12 6:42 ` ubizjak at gmail dot com
2008-03-12 6:43 ` ubizjak at gmail dot com
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).