public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
@ 2011-02-26 20:59 mikpe at it dot uu.se
  2011-02-26 21:33 ` [Bug target/47908] " mikpe at it dot uu.se
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-26 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: attribute((optimize(2))) causes ICE in
                    m68k_sched_issue_rate
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikpe@it.uu.se


When targeting m68k-linux, if a function declaration has
__attribute__((__optimize__(2))), then gcc ICEs in m68k_sched_issue_rate:

> cat O16384.c
__attribute__((__optimize__(2))) void foo (void) { }
> objdir/gcc/xgcc -Bobjdir/gcc -S O16384.c
O16384.c: In function 'foo':
O16384.c:1:1: internal compiler error: in m68k_sched_issue_rate, at
config/m68k/m68k.c:6055
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The immediate cause is that m68k_sched_cpu indicates a non-ColdFire target, and
m68k_sched_issue_rate explicitly calls gcc_unreachable in that case.  I don't
know why attribute((optimize(2))) causes scheduling to be attempted, esp. since
m68k_option_override seems to disable a number of scheduling-related flags.

This bug causes gcc.dg/O16384.c to fail with gcc-4.4.5/4.5.2/4.6.0 on
m68k-linux.  With gcc-4.3.5 the optimize attribute is ignored and there is no
ICE.

> objdir/gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=objdir/gcc/xgcc
Target: m68k-unknown-linux
Configured with: /tmp/gcc-4.6-20110219/configure --target=m68k-unknown-linux
--prefix=/home/mikpe/pkgs/linux-x86/cross-m68k
--with-gmp=/home/mikpe/pkgs/linux-x86/gmp-4.3.2
--with-mpfr=/home/mikpe/pkgs/linux-x86/mpfr-2.4.2
--with-mpc=/home/mikpe/pkgs/linux-x86/mpc-0.8.2 --disable-plugin --disable-lto
--disable-nls --enable-shared --disable-libmudflap --disable-multilib
--enable-threads=posix --enable-checking=release --enable-languages=c
Thread model: posix
gcc version 4.6.0 20110219 (experimental) (GCC)


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
@ 2011-02-26 21:33 ` mikpe at it dot uu.se
  2011-03-01 23:45 ` mikpe at it dot uu.se
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-26 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-26 21:04:19 UTC ---
Other test cases that fail for the same reason include gcc.dg/pr37106-1.c,
gcc.dg/pr43562.c, and gcc.dg/pr43564.c.


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
  2011-02-26 21:33 ` [Bug target/47908] " mikpe at it dot uu.se
@ 2011-03-01 23:45 ` mikpe at it dot uu.se
  2011-04-10 18:36 ` alanh at fairlite dot co.uk
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mikpe at it dot uu.se @ 2011-03-01 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2011-03-01 23:45:01 UTC ---
m68k needs to define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE in order to override
the instruction scheduling options implied by attribute((optimize(2))).


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
  2011-02-26 21:33 ` [Bug target/47908] " mikpe at it dot uu.se
  2011-03-01 23:45 ` mikpe at it dot uu.se
@ 2011-04-10 18:36 ` alanh at fairlite dot co.uk
  2011-04-11  7:36 ` mikpe at it dot uu.se
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: alanh at fairlite dot co.uk @ 2011-04-10 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Hourihane <alanh at fairlite dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alanh at fairlite dot co.uk

--- Comment #3 from Alan Hourihane <alanh at fairlite dot co.uk> 2011-04-10 18:36:37 UTC ---
I'm also hitting this when compiling tar 1.26 with gcc 4.5.2 from Gentoo.


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (2 preceding siblings ...)
  2011-04-10 18:36 ` alanh at fairlite dot co.uk
@ 2011-04-11  7:36 ` mikpe at it dot uu.se
  2011-07-26 20:57 ` schwab@linux-m68k.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mikpe at it dot uu.se @ 2011-04-11  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Mikael Pettersson <mikpe at it dot uu.se> 2011-04-11 07:36:17 UTC ---
I have fully tested patches to fix this for 4.4.5, 4.5.2, and 4.6.0 (presumably
that one will also work for 4.7 but I haven't checked), but I've avoided
posting them because the FSF hasn't yet confirmed that my copyright assignment
is in place. (They've had the papers for ages.) I just pinged them again.

Meanwhile you can just comment out any offending attribute((optimize(...))).


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (3 preceding siblings ...)
  2011-04-11  7:36 ` mikpe at it dot uu.se
@ 2011-07-26 20:57 ` schwab@linux-m68k.org
  2011-07-27 23:29 ` tg at mirbsd dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: schwab@linux-m68k.org @ 2011-07-26 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tg at mirbsd dot org

--- Comment #5 from Andreas Schwab <schwab@linux-m68k.org> 2011-07-26 20:57:11 UTC ---
*** Bug 49856 has been marked as a duplicate of this bug. ***


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (4 preceding siblings ...)
  2011-07-26 20:57 ` schwab@linux-m68k.org
@ 2011-07-27 23:29 ` tg at mirbsd dot org
  2011-07-29 11:44 ` mikpe at it dot uu.se
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tg at mirbsd dot org @ 2011-07-27 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Thorsten Glaser <tg at mirbsd dot org> 2011-07-27 23:29:13 UTC ---
Mikael, can you please publish your “fully tested patches to fix this for
4.4.5, 4.5.2, and 4.6.0” so we can at least include this in the packages?

If the FSF itself (i.e. gnulib) starts using those pragmas which cause
this ICE, I think we’re going to see more and more popping up; I could
convince the maintainer of libvirt to include the m68k workaround in
his package (compile with -DWRAPV -fwrapv) but that doesn’t really scale.

Without the copyright assignment (WTF is going on there, mine took about
three weeks!) it’s still distributable under GPL, just with you as author.

Thanks!


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (5 preceding siblings ...)
  2011-07-27 23:29 ` tg at mirbsd dot org
@ 2011-07-29 11:44 ` mikpe at it dot uu.se
  2011-07-31 15:01 ` schwab at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mikpe at it dot uu.se @ 2011-07-29 11:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Mikael Pettersson <mikpe at it dot uu.se> 2011-07-29 11:44:34 UTC ---
Created attachment 24863
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24863
fix for gcc-4.5.3 and gcc-4.4.6

A patch for trunk and gcc-4.6.1 has been posted:
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02514.html

I'm attaching the corresponding patch for gcc-4.5.3 and gcc-4.4.6 here, in case
anyone needs the fix for those branches.


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (6 preceding siblings ...)
  2011-07-29 11:44 ` mikpe at it dot uu.se
@ 2011-07-31 15:01 ` schwab at gcc dot gnu.org
  2011-07-31 15:09 ` schwab at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: schwab at gcc dot gnu.org @ 2011-07-31 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andreas Schwab <schwab at gcc dot gnu.org> 2011-07-31 15:01:02 UTC ---
Author: schwab
Date: Sun Jul 31 15:00:58 2011
New Revision: 176975

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176975
Log:
Author: Mikael Pettersson <mikpe@it.uu.se>

PR target/47908
* gcc/config/m68k/m68k.c (m68k_override_options_after_change): New function.
Disable instruction scheduling for non-ColdFire targets.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/m68k/m68k.c


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (7 preceding siblings ...)
  2011-07-31 15:01 ` schwab at gcc dot gnu.org
@ 2011-07-31 15:09 ` schwab at gcc dot gnu.org
  2011-08-01 13:45 ` owner at bugs dot debian.org
  2011-08-22 12:04 ` schwab@linux-m68k.org
  10 siblings, 0 replies; 12+ messages in thread
From: schwab at gcc dot gnu.org @ 2011-07-31 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Andreas Schwab <schwab at gcc dot gnu.org> 2011-07-31 15:09:28 UTC ---
Author: schwab
Date: Sun Jul 31 15:09:25 2011
New Revision: 176976

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176976
Log:
Author: Mikael Pettersson <mikpe@it.uu.se>

PR target/47908
* gcc/config/m68k/m68k.c (m68k_override_options_after_change): New function.
Disable instruction scheduling for non-ColdFire targets.
(TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Define.

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


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (8 preceding siblings ...)
  2011-07-31 15:09 ` schwab at gcc dot gnu.org
@ 2011-08-01 13:45 ` owner at bugs dot debian.org
  2011-08-22 12:04 ` schwab@linux-m68k.org
  10 siblings, 0 replies; 12+ messages in thread
From: owner at bugs dot debian.org @ 2011-08-01 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from owner at bugs dot debian.org 2011-08-01 13:45:23 UTC ---
Thank you for the additional information you have supplied regarding
this Bug report.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 Debian GCC Maintainers <debian-gcc@lists.debian.org>

If you wish to submit further information on this problem, please
send it to 635919@bugs.debian.org.

Please do not send mail to owner@bugs.debian.org unless you wish
to report a problem with the Bug-tracking system.


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

* [Bug target/47908] attribute((optimize(2))) causes ICE in m68k_sched_issue_rate
  2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
                   ` (9 preceding siblings ...)
  2011-08-01 13:45 ` owner at bugs dot debian.org
@ 2011-08-22 12:04 ` schwab@linux-m68k.org
  10 siblings, 0 replies; 12+ messages in thread
From: schwab@linux-m68k.org @ 2011-08-22 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Andreas Schwab <schwab@linux-m68k.org> 2011-08-22 11:58:27 UTC ---
Fixed for 4.6 and trunk.


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

end of thread, other threads:[~2011-08-22 11:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-26 20:59 [Bug target/47908] New: attribute((optimize(2))) causes ICE in m68k_sched_issue_rate mikpe at it dot uu.se
2011-02-26 21:33 ` [Bug target/47908] " mikpe at it dot uu.se
2011-03-01 23:45 ` mikpe at it dot uu.se
2011-04-10 18:36 ` alanh at fairlite dot co.uk
2011-04-11  7:36 ` mikpe at it dot uu.se
2011-07-26 20:57 ` schwab@linux-m68k.org
2011-07-27 23:29 ` tg at mirbsd dot org
2011-07-29 11:44 ` mikpe at it dot uu.se
2011-07-31 15:01 ` schwab at gcc dot gnu.org
2011-07-31 15:09 ` schwab at gcc dot gnu.org
2011-08-01 13:45 ` owner at bugs dot debian.org
2011-08-22 12:04 ` schwab@linux-m68k.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).