public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE
@ 2014-08-04 21:04 e.menezes at samsung dot com
  2014-08-04 21:07 ` [Bug target/62014] " pinskia at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-04 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 62014
           Summary: [AArch64] Using -mgeneral-regs-only may lead to ICE
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: e.menezes at samsung dot com

Created attachment 33245
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33245&action=edit
This patch should fix this issue, though it needs a test-case.

In some cases, when the LRA spills a register into an FP register, with the
option -mgeneral-regs-only specified, there is an ICE.

It seems to be caused by the LRA assuming that the FP registers are always
available and not being told when they aren't by the target.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
@ 2014-08-04 21:07 ` pinskia at gcc dot gnu.org
  2014-08-04 21:15 ` e.menezes at samsung dot com
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-04 21:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
+  /* Do not spill into FP registers when "-mgeneral-regs-only" is specified. *

You are missing a / in your comment.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
  2014-08-04 21:07 ` [Bug target/62014] " pinskia at gcc dot gnu.org
@ 2014-08-04 21:15 ` e.menezes at samsung dot com
  2014-08-04 21:16 ` e.menezes at samsung dot com
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-04 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Evandro Menezes <e.menezes at samsung dot com> ---
(In reply to Andrew Pinski from comment #1)
> +  /* Do not spill into FP registers when "-mgeneral-regs-only" is
> specified. *
> 
> You are missing a / in your comment.

Ermahgerd!


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
  2014-08-04 21:07 ` [Bug target/62014] " pinskia at gcc dot gnu.org
  2014-08-04 21:15 ` e.menezes at samsung dot com
@ 2014-08-04 21:16 ` e.menezes at samsung dot com
  2014-08-05  6:55 ` ktkachov at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-04 21:16 UTC (permalink / raw)
  To: gcc-bugs

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

Evandro Menezes <e.menezes at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33245|0                           |1
        is obsolete|                            |

--- Comment #3 from Evandro Menezes <e.menezes at samsung dot com> ---
Created attachment 33246
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33246&action=edit
This patch should fix this issue, though it needs a test-case


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (2 preceding siblings ...)
  2014-08-04 21:16 ` e.menezes at samsung dot com
@ 2014-08-05  6:55 ` ktkachov at gcc dot gnu.org
  2014-08-05  8:33 ` ramana at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-08-05  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #4 from ktkachov at gcc dot gnu.org ---
(In reply to Evandro Menezes from comment #3)
> Created attachment 33246 [details]
> This patch should fix this issue, though it needs a test-case

Please post to gcc-patches with a testcase.
I'd prefer if you used TARGET_FP rather than !TARGET_GENERAL_REGS_ONLY


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (3 preceding siblings ...)
  2014-08-05  6:55 ` ktkachov at gcc dot gnu.org
@ 2014-08-05  8:33 ` ramana at gcc dot gnu.org
  2014-08-05  8:50 ` ktkachov at gcc dot gnu.org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-05  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |aarch64-*
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-08-05
     Ever confirmed|0                           |1

--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
According to the documentation, not defining TARGET_SPILL_CLASS is equivalent
to returning NO_REGS for all inputs. 

The symptoms that you describe indicate a problem elsewhere or an attempt to
paper over the problem rather than the correct fix. The smoking gun for me is
to suspect an errant pattern with incorrectly marked simd attributes rather
than anything else. Look at the way in which the simd attribute is set on
*addsi3_aarch64 for e.g.

Without a testcase and without instructions to reproduce the problems as per
https://gcc.gnu.org/bugs/#report it is not possible to work out what's going on
here.

Next time please also remember to fill in Target, Known to work, Known to fail
and Keywords fields as well.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (4 preceding siblings ...)
  2014-08-05  8:33 ` ramana at gcc dot gnu.org
@ 2014-08-05  8:50 ` ktkachov at gcc dot gnu.org
  2014-08-05  9:02 ` ramana at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-08-05  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from ktkachov at gcc dot gnu.org ---
One crude way to look is by looking for the "w" constraint that signifies usage
of FP registers in the md files and seeing whether those usages are properly
guarded by the 'simd' attribute or by TARGET_FLOAT/TARGET_SIMD.

One quick search shows the absdi2 define_insn_and_split that uses 'w' in its
second alternative to emit "abs\\t%d0, %d1" but doesn't guard it by the 'simd'
attribute. Maybe that's a place to start to construct a testcase


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (5 preceding siblings ...)
  2014-08-05  8:50 ` ktkachov at gcc dot gnu.org
@ 2014-08-05  9:02 ` ramana at gcc dot gnu.org
  2014-08-05  9:04 ` ktkachov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-08-05  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
(In reply to ktkachov from comment #6)
> One crude way to look is by looking for the "w" constraint that signifies
> usage of FP registers in the md files and seeing whether those usages are
> properly guarded by the 'simd' attribute or by TARGET_FLOAT/TARGET_SIMD.
> 
> One quick search shows the absdi2 define_insn_and_split that uses 'w' in its
> second alternative to emit "abs\\t%d0, %d1" but doesn't guard it by the
> 'simd' attribute. Maybe that's a place to start to construct a testcase

Thanks, I was about to do this after my morning cuppa :) 

If this was noticed from a testcase, it should be trivial to work out which
pattern it was that had the w registers by just looking at the output with -dp.
Anyway I agree that absdi2 looks the most suspicious.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (6 preceding siblings ...)
  2014-08-05  9:02 ` ramana at gcc dot gnu.org
@ 2014-08-05  9:04 ` ktkachov at gcc dot gnu.org
  2014-08-05 15:36 ` e.menezes at samsung dot com
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-08-05  9:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from ktkachov at gcc dot gnu.org ---
Also, James pointed out the patterns in the region of aarch64_movtilow_tilow.
They use SIMD registers to move wide values but are not guarded.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (7 preceding siblings ...)
  2014-08-05  9:04 ` ktkachov at gcc dot gnu.org
@ 2014-08-05 15:36 ` e.menezes at samsung dot com
  2014-08-05 15:38 ` ktkachov at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-05 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Evandro Menezes <e.menezes at samsung dot com> ---
It seems to me that it's the LRA which is forcing the use of FP registers, so,
even if the patterns are fixed, I believe that in the end the combiner would
just give up and ICE.  With this assumption, which is open to corrections, I
believe that the LRA needs to be properly managed according to the options
passed on to the target.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (8 preceding siblings ...)
  2014-08-05 15:36 ` e.menezes at samsung dot com
@ 2014-08-05 15:38 ` ktkachov at gcc dot gnu.org
  2014-08-05 15:40 ` e.menezes at samsung dot com
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-08-05 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from ktkachov at gcc dot gnu.org ---
What we really need here is a preprocessed testcase showing the problem.
It should be fairly easy to lock down on the problem then


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (9 preceding siblings ...)
  2014-08-05 15:38 ` ktkachov at gcc dot gnu.org
@ 2014-08-05 15:40 ` e.menezes at samsung dot com
  2014-08-05 16:55 ` rearnsha at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-05 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Evandro Menezes <e.menezes at samsung dot com> ---
(In reply to ktkachov from comment #10)
> What we really need here is a preprocessed testcase showing the problem.
> It should be fairly easy to lock down on the problem then

I'm on it.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (10 preceding siblings ...)
  2014-08-05 15:40 ` e.menezes at samsung dot com
@ 2014-08-05 16:55 ` rearnsha at gcc dot gnu.org
  2014-08-05 23:48 ` e.menezes at samsung dot com
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2014-08-05 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
aarch64_conditional_register_usage() marks all FP registers as unavailable if
!TARGET_FLOAT.  So the real question is why this isn't sufficient to disable
use of FP registers.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (11 preceding siblings ...)
  2014-08-05 16:55 ` rearnsha at gcc dot gnu.org
@ 2014-08-05 23:48 ` e.menezes at samsung dot com
  2014-08-06  0:02 ` e.menezes at samsung dot com
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-05 23:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Evandro Menezes <e.menezes at samsung dot com> ---
Created attachment 33253
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33253&action=edit
Test-case

This test-case is a stripped-down version of Dhrystone, where the issue was
first observed.

Built with just -O2, it ends up with a handful of FMOVs, which are then avoided
if -mno-lra is also specified.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (12 preceding siblings ...)
  2014-08-05 23:48 ` e.menezes at samsung dot com
@ 2014-08-06  0:02 ` e.menezes at samsung dot com
  2014-08-06  8:28 ` ktkachov at gcc dot gnu.org
  2014-08-06 22:13 ` e.menezes at samsung dot com
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-06  0:02 UTC (permalink / raw)
  To: gcc-bugs

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

Evandro Menezes <e.menezes at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33246|0                           |1
        is obsolete|                            |

--- Comment #14 from Evandro Menezes <e.menezes at samsung dot com> ---
Created attachment 33254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33254&action=edit
Patch

For the sake of correctness, this patch uses the more generic flag to qualify
the spilling.


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (13 preceding siblings ...)
  2014-08-06  0:02 ` e.menezes at samsung dot com
@ 2014-08-06  8:28 ` ktkachov at gcc dot gnu.org
  2014-08-06 22:13 ` e.menezes at samsung dot com
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-08-06  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from ktkachov at gcc dot gnu.org ---
I can't reproduce this with current trunk and 4.9.1.
What exact compiler version and options did you use?
I used -O2 -mgeneral-regs-only on an aarch64-none-elf compiler
gcc version 4.10.0 20140805


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

* [Bug target/62014] [AArch64] Using -mgeneral-regs-only may lead to ICE
  2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
                   ` (14 preceding siblings ...)
  2014-08-06  8:28 ` ktkachov at gcc dot gnu.org
@ 2014-08-06 22:13 ` e.menezes at samsung dot com
  15 siblings, 0 replies; 17+ messages in thread
From: e.menezes at samsung dot com @ 2014-08-06 22:13 UTC (permalink / raw)
  To: gcc-bugs

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

Evandro Menezes <e.menezes at samsung dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #16 from Evandro Menezes <e.menezes at samsung dot com> ---
If it's working, it's good for me.


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

end of thread, other threads:[~2014-08-06 22:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04 21:04 [Bug target/62014] New: [AArch64] Using -mgeneral-regs-only may lead to ICE e.menezes at samsung dot com
2014-08-04 21:07 ` [Bug target/62014] " pinskia at gcc dot gnu.org
2014-08-04 21:15 ` e.menezes at samsung dot com
2014-08-04 21:16 ` e.menezes at samsung dot com
2014-08-05  6:55 ` ktkachov at gcc dot gnu.org
2014-08-05  8:33 ` ramana at gcc dot gnu.org
2014-08-05  8:50 ` ktkachov at gcc dot gnu.org
2014-08-05  9:02 ` ramana at gcc dot gnu.org
2014-08-05  9:04 ` ktkachov at gcc dot gnu.org
2014-08-05 15:36 ` e.menezes at samsung dot com
2014-08-05 15:38 ` ktkachov at gcc dot gnu.org
2014-08-05 15:40 ` e.menezes at samsung dot com
2014-08-05 16:55 ` rearnsha at gcc dot gnu.org
2014-08-05 23:48 ` e.menezes at samsung dot com
2014-08-06  0:02 ` e.menezes at samsung dot com
2014-08-06  8:28 ` ktkachov at gcc dot gnu.org
2014-08-06 22:13 ` e.menezes at samsung 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).