public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
@ 2012-05-04  8:33 rguenth at gcc dot gnu.org
  2012-05-04  8:34 ` [Bug target/53228] " rguenth at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-04  8:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

             Bug #: 53228
           Summary: [4.6/4.7/4.8 Regression] target attributes in
                    libcpp/lex.c cause illegal instructions to be used
                    elsewhere
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: major
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


When building libcpp/lex.c for -march=i586 and -mtune=generic on i586-linux-gnu
generic code contains cmov* instructions which will SIGILL on

finger@mtech:~> cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 8
model name      : AMD-K6(tm) 3D processor
stepping        : 12
microcode       : 0x8b
cpu MHz         : 428.811
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr cx8 pge mmx syscall 3dnow k6_mtrr up
bogomips        : 857.62
clflush size    : 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
power management:

CPUs which are perfectly fine matching -march=i586.

When you remove all target attribute annotated code from lex.c these
instructions disappear.

Thus, a compiler built for i586 does not work.

The bug persists with GCC 4.6, 4.7 and 4.8.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
@ 2012-05-04  8:34 ` rguenth at gcc dot gnu.org
  2012-05-04  8:35 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-04  8:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-04 08:33:53 UTC ---
Created attachment 27304
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27304
preprocessed source

Preprocessed lex.c from the 4.6 branch.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
  2012-05-04  8:34 ` [Bug target/53228] " rguenth at gcc dot gnu.org
@ 2012-05-04  8:35 ` rguenth at gcc dot gnu.org
  2012-05-04  8:43 ` pinskia at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-04  8:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i?86-*-*
   Target Milestone|---                         |4.6.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
  2012-05-04  8:34 ` [Bug target/53228] " rguenth at gcc dot gnu.org
  2012-05-04  8:35 ` rguenth at gcc dot gnu.org
@ 2012-05-04  8:43 ` pinskia at gcc dot gnu.org
  2012-05-04  8:58 ` rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-04  8:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-04 08:43:09 UTC ---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49104 ?


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-05-04  8:43 ` pinskia at gcc dot gnu.org
@ 2012-05-04  8:58 ` rguenth at gcc dot gnu.org
  2012-05-04 11:38 ` ubizjak at gmail dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-04  8:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-04 08:57:44 UTC ---
The revision that supposedly fixed the issue is in reporters sources
(for reference: https://bugzilla.novell.com/show_bug.cgi?id=760210).

Note that I see cmov* instructions in _cpp_clean_line, _cpp_temp_token,
cpp_avoid_paste, cpp_output_line_to_string and more.  _Not_ only in the
SSE marked functions.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-05-04  8:58 ` rguenth at gcc dot gnu.org
@ 2012-05-04 11:38 ` ubizjak at gmail dot com
  2012-05-04 11:44 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ubizjak at gmail dot com @ 2012-05-04 11:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-05-04
         AssignedTo|unassigned at gcc dot       |ubizjak at gmail dot com
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-04 11:37:48 UTC ---
Created attachment 27305
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27305
Proposed patch

Untested patch that changes TARGET_CMOVE test.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-05-04 11:38 ` ubizjak at gmail dot com
@ 2012-05-04 11:44 ` rguenth at gcc dot gnu.org
  2012-05-04 12:47 ` ubizjak at gmail dot com
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-04 11:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-04 11:44:02 UTC ---
I can confirm the patch works though I don't trivially see how it fixes the
interaction with the option save/restore code ;)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-05-04 11:44 ` rguenth at gcc dot gnu.org
@ 2012-05-04 12:47 ` ubizjak at gmail dot com
  2012-05-04 16:43 ` uros at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: ubizjak at gmail dot com @ 2012-05-04 12:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #6 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-04 12:46:24 UTC ---
(In reply to comment #5)
> I can confirm the patch works though I don't trivially see how it fixes the
> interaction with the option save/restore code ;)

It doesn't "fix" anything in option processing code, the patch avoids changing
ix86_arch_features behind option processing back.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-05-04 12:47 ` ubizjak at gmail dot com
@ 2012-05-04 16:43 ` uros at gcc dot gnu.org
  2012-05-04 16:59 ` uros at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uros at gcc dot gnu.org @ 2012-05-04 16:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #7 from uros at gcc dot gnu.org 2012-05-04 16:42:32 UTC ---
Author: uros
Date: Fri May  4 16:42:23 2012
New Revision: 187168

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187168
Log:
    PR target/53228
    * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE.
    (TARGET_CMOV): Rename from TARGET_CMOVE.
    (TARGET_CMOVE): New define.
    * config/i386/i386.c (ix86_option_override_internal): Use TARGET_CMOV.
    Do not set TARGET_CMOVE here.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.h


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-05-04 16:43 ` uros at gcc dot gnu.org
@ 2012-05-04 16:59 ` uros at gcc dot gnu.org
  2012-05-04 17:49 ` uros at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uros at gcc dot gnu.org @ 2012-05-04 16:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #8 from uros at gcc dot gnu.org 2012-05-04 16:58:21 UTC ---
Author: uros
Date: Fri May  4 16:58:16 2012
New Revision: 187169

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187169
Log:
    Backport from mainline
    2012-05-04  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53228
    * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE.
    (TARGET_CMOV): Rename from TARGET_CMOVE.
    (TARGET_CMOVE): New define.
    * config/i386/i386.c (ix86_option_override_internal): Use TARGET_CMOV.
    Do not set TARGET_CMOVE here.


Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/i386/i386.c
    branches/gcc-4_7-branch/gcc/config/i386/i386.h


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2012-05-04 16:59 ` uros at gcc dot gnu.org
@ 2012-05-04 17:49 ` uros at gcc dot gnu.org
  2012-05-04 18:43 ` uros at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uros at gcc dot gnu.org @ 2012-05-04 17:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #9 from uros at gcc dot gnu.org 2012-05-04 17:49:00 UTC ---
Author: uros
Date: Fri May  4 17:48:56 2012
New Revision: 187171

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187171
Log:
    Backport from mainline
    2012-05-04  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53228
    * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE.
    (TARGET_CMOV): Rename from TARGET_CMOVE.
    (TARGET_CMOVE): New define.
    * config/i386/i386.c (ix86_option_override_internal): Use TARGET_CMOV.
    Do not set TARGET_CMOVE here.


Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/i386/i386.c
    branches/gcc-4_6-branch/gcc/config/i386/i386.h


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2012-05-04 17:49 ` uros at gcc dot gnu.org
@ 2012-05-04 18:43 ` uros at gcc dot gnu.org
  2012-05-04 18:46 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: uros at gcc dot gnu.org @ 2012-05-04 18:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

--- Comment #10 from uros at gcc dot gnu.org 2012-05-04 18:43:16 UTC ---
Author: uros
Date: Fri May  4 18:43:10 2012
New Revision: 187172

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187172
Log:
    Backport from mainline
    2012-05-04  Uros Bizjak  <ubizjak@gmail.com>

    PR target/53228
    * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE.
    (TARGET_CMOV): Rename from TARGET_CMOVE.
    (TARGET_CMOVE): New define.
    * config/i386/i386.c (override_options): Use TARGET_CMOV.
    Do not set TARGET_CMOVE here.


Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/config/i386/i386.c
    branches/gcc-4_5-branch/gcc/config/i386/i386.h


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2012-05-04 18:43 ` uros at gcc dot gnu.org
@ 2012-05-04 18:46 ` ubizjak at gmail dot com
  2021-08-15  5:42 ` pinskia at gcc dot gnu.org
  2021-08-15  5:43 ` pinskia at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: ubizjak at gmail dot com @ 2012-05-04 18:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2012-05/msg00360.htm
                   |                            |l
         Resolution|                            |FIXED
   Target Milestone|4.6.4                       |4.5.4

--- Comment #11 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-04 18:45:58 UTC ---
Fixed everywhere.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2012-05-04 18:46 ` ubizjak at gmail dot com
@ 2021-08-15  5:42 ` pinskia at gcc dot gnu.org
  2021-08-15  5:43 ` pinskia at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15  5:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aivchenk at gmail dot com

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 55816 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/53228] [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere
  2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-08-15  5:42 ` pinskia at gcc dot gnu.org
@ 2021-08-15  5:43 ` pinskia at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15  5:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53228

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michael at talosis dot ca

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 48326 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-08-15  5:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04  8:33 [Bug target/53228] New: [4.6/4.7/4.8 Regression] target attributes in libcpp/lex.c cause illegal instructions to be used elsewhere rguenth at gcc dot gnu.org
2012-05-04  8:34 ` [Bug target/53228] " rguenth at gcc dot gnu.org
2012-05-04  8:35 ` rguenth at gcc dot gnu.org
2012-05-04  8:43 ` pinskia at gcc dot gnu.org
2012-05-04  8:58 ` rguenth at gcc dot gnu.org
2012-05-04 11:38 ` ubizjak at gmail dot com
2012-05-04 11:44 ` rguenth at gcc dot gnu.org
2012-05-04 12:47 ` ubizjak at gmail dot com
2012-05-04 16:43 ` uros at gcc dot gnu.org
2012-05-04 16:59 ` uros at gcc dot gnu.org
2012-05-04 17:49 ` uros at gcc dot gnu.org
2012-05-04 18:43 ` uros at gcc dot gnu.org
2012-05-04 18:46 ` ubizjak at gmail dot com
2021-08-15  5:42 ` pinskia at gcc dot gnu.org
2021-08-15  5:43 ` pinskia at gcc dot gnu.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).