public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
@ 2013-05-21 19:16 mib.bugzilla at gmail dot com
  2013-05-21 19:18 ` [Bug c++/57362] " mib.bugzilla at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mib.bugzilla at gmail dot com @ 2013-05-21 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57362
           Summary: unsupported __attribute__((target())) values appear to
                    cause loop and/or pathological behavior
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mib.bugzilla at gmail dot com

Created attachment 30158
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30158&action=edit
Test case

I was experimenting with what values might be acceptable to gcc 4.8
__attribute__((target()))

I expected that the compiler would flag the targets that weren't recognized and
then quit, but it ran a very long time (5 minutes?). I stopped the job and
process cc1plus was still running.


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

* [Bug c++/57362] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
@ 2013-05-21 19:18 ` mib.bugzilla at gmail dot com
  2013-05-22  8:17 ` [Bug c++/57362] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mib.bugzilla at gmail dot com @ 2013-05-21 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from mib.bugzilla at gmail dot com ---
Using built-in specs.
COLLECT_GCC=/rdrive/ref/gcc/4.8.0/rhel60/efi2/bin/g++
COLLECT_LTO_WRAPPER=/site/spt/rdrive/ref/gcc/4.8.0/rhel60/efi2/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
/rusers/sys_cron/grab_gcc/downloads_rel/4.8.0/gcc-4.8.0/configure
--prefix=/rdrive/ref/gcc/4.8.0/rhel60/efi2
--enable-languages=c,c++,objc,fortran --disable-multilib --enable-bootstrap
--target=x86_64-unknown-linux-gnu --disable-bootstrap --enable-decimal-float
--with-gmp=/rusers/sys_cron/grab_gcc/downloads_rel/lib/efi2
--with-mpfr=/rusers/sys_cron/grab_gcc/downloads_rel/lib/efi2
--with-mpc=/rusers/sys_cron/grab_gcc/downloads_rel/lib/efi2
Thread model: posix
gcc version 4.8.0 (GCC)


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
  2013-05-21 19:18 ` [Bug c++/57362] " mib.bugzilla at gmail dot com
@ 2013-05-22  8:17 ` rguenth at gcc dot gnu.org
  2013-05-22 23:46 ` tmsriram at google dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-22  8:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.7.3
            Version|unknown                     |4.8.1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|                            |2013-05-22
                 CC|                            |tmsriram at google dot com
     Ever confirmed|0                           |1
            Summary|unsupported                 |[4.8/4.9 Regression]
                   |__attribute__((target()))   |unsupported
                   |values appear to cause loop |__attribute__((target()))
                   |and/or pathological         |values appear to cause loop
                   |behavior                    |and/or pathological
                   |                            |behavior
   Target Milestone|---                         |4.8.1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Works fine with the C compiler, for the C++ compiler we ICE:

... lots of errors ...
t.c:18:5: error: No dispatcher found for align-stringops
 int foo(void) { return 1; }
     ^
t.c:187:20: internal compiler error: Segmentation fault
       result = foo();
                    ^
0xc647e5 crash_signal
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/toplev.c:332
0x53f4cb contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/tree.h:3797
0x9b6742 build_fold_addr_expr_loc(unsigned int, tree_node*)
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/fold-const.c:7693
0xf498fa add_condition_to_bb
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/config/i386/i386.c:28536
0xf4a6d0 dispatch_function_versions
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/config/i386/i386.c:28951
0xf4c178 ix86_generate_version_dispatcher_body
        /space/rguenther/src/svn/gcc-4_8-branch/gcc/config/i386/i386.c:29517


you cannot query for acceptable values by re-annotating the same decl.

GCC 4.7 happily says

...
t.c:176:5: error: redefinition of 'int foo()'
t.c:2:5: error: 'int foo()' previously defined here
t.c: At global scope:
t.c:178:13: error: attribute(target("avx256-split-unaligned-store")) is unknown
t.c: In function 'int foo()':
t.c:178:5: error: redefinition of 'int foo()'
t.c:2:5: error: 'int foo()' previously defined here
t.c: At global scope:
t.c:180:13: error: attribute(target("rtm")) is unknown
t.c: In function 'int foo()':
t.c:180:5: error: redefinition of 'int foo()'
t.c:2:5: error: 'int foo()' previously defined here

and does not ICE.

Google folks - please have a look.


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
  2013-05-21 19:18 ` [Bug c++/57362] " mib.bugzilla at gmail dot com
  2013-05-22  8:17 ` [Bug c++/57362] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-05-22 23:46 ` tmsriram at google dot com
  2013-05-31 10:58 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tmsriram at google dot com @ 2013-05-22 23:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sriraman Tallam <tmsriram at google dot com> ---
Patch proposed to fix this problem,

This happens when a subset of versions are invalid because of unrecognized
target string name or if a dispatcher for that is not available.  When
constructing the versions array to dispatch, the index used here is wrong.


       PR 57362
        * config/i386/i386.c (dispatch_function_versions):  Use actual_versions 
        to index into function_version_info.

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 199219)
+++ config/i386/i386.c  (working copy)
@@ -29061,10 +29061,10 @@ dispatch_function_versions (tree dispatch_decl,
       if (predicate_chain == NULL_TREE)
        continue;

+      function_version_info [actual_versions].version_decl = version_decl;
+      function_version_info [actual_versions].predicate_chain =
predicate_chain;
+      function_version_info [actual_versions].dispatch_priority = priority;
       actual_versions++;
-      function_version_info [ix - 1].version_decl = version_decl;
-      function_version_info [ix - 1].predicate_chain = predicate_chain;
-      function_version_info [ix - 1].dispatch_priority = priority;
     }

   /* Sort the versions according to descending order of dispatch priority. 
The


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
                   ` (2 preceding siblings ...)
  2013-05-22 23:46 ` tmsriram at google dot com
@ 2013-05-31 10:58 ` jakub at gcc dot gnu.org
  2013-07-11 23:07 ` tmsriram at google dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
                   ` (3 preceding siblings ...)
  2013-05-31 10:58 ` jakub at gcc dot gnu.org
@ 2013-07-11 23:07 ` tmsriram at google dot com
  2013-07-11 23:31 ` paolo.carlini at oracle dot com
  2013-07-31 20:12 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: tmsriram at google dot com @ 2013-07-11 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sriraman Tallam <tmsriram at google dot com> ---
Trunk rev. 200913 fixes this problem.


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
                   ` (4 preceding siblings ...)
  2013-07-11 23:07 ` tmsriram at google dot com
@ 2013-07-11 23:31 ` paolo.carlini at oracle dot com
  2013-07-31 20:12 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-11 23:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
What about 4_8-branch? The bug is marked as 4.8 Regression. Either way, I
suppose the bug should be closed, right?


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

* [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
  2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
                   ` (5 preceding siblings ...)
  2013-07-11 23:31 ` paolo.carlini at oracle dot com
@ 2013-07-31 20:12 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2013-07-31 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.2 (r201388) and 4.9.


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

end of thread, other threads:[~2013-07-31 20:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 19:16 [Bug c++/57362] New: unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior mib.bugzilla at gmail dot com
2013-05-21 19:18 ` [Bug c++/57362] " mib.bugzilla at gmail dot com
2013-05-22  8:17 ` [Bug c++/57362] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2013-05-22 23:46 ` tmsriram at google dot com
2013-05-31 10:58 ` jakub at gcc dot gnu.org
2013-07-11 23:07 ` tmsriram at google dot com
2013-07-11 23:31 ` paolo.carlini at oracle dot com
2013-07-31 20:12 ` jason 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).