Bug 37369 - ice for legal C code
Summary: ice for legal C code
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-04 11:53 UTC by David Binderman
Modified: 2019-04-30 09:31 UTC (History)
1 user (show)

See Also:
Host: suse-linux-x86_64
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
C source code (47.10 KB, text/plain)
2008-09-04 11:54 UTC, David Binderman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2008-09-04 11:53:27 UTC
I just tried to compile the Suse Linux package enlightenment-0.16.8.12-15
with the GNU C compiler version 4.4 snapshot 20080829

The compiler said

backgrounds.c: In function 'BackgroundGetUniqueString':
backgrounds.c:2742: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Pre-processed source code attached. Flag -O2 required.

Here is a valgrind stack back trace

==6993== Invalid read of size 1
==6993==    at 0x875CB0: cgraph_expand_function (cgraphunit.c:1043)
==6993==    by 0x877A1C: cgraph_optimize (cgraphunit.c:1101)
==6993==    by 0x416782: c_write_global_declarations (c-decl.c:8055)
==6993==    by 0x6B6C16: toplev_main (toplev.c:979)
==6993==    by 0x52D3435: (below main) (in /lib64/libc-2.8.so)
==6993==  Address 0x2 is not stack'd, malloc'd or (recently) free'd
Comment 1 David Binderman 2008-09-04 11:54:47 UTC
Created attachment 16221 [details]
C source code
Comment 2 Richard Biener 2008-09-04 12:21:36 UTC
I can not reproduce this with the current trunk.  I suggest you update your
snapshot before filing more bugreports.  Thanks.
Comment 3 Richard Earnshaw 2018-12-11 11:26:47 UTC
Author: rearnsha
Date: Tue Dec 11 11:26:15 2018
New Revision: 267019

URL: https://gcc.gnu.org/viewcvs?rev=267019&root=gcc&view=rev
Log:
[aarch64] PR target/87369 Prefer bsl/bit/bif for copysign

The copysign operations will almost always be performed on values in
floating-point registers.  As such, we do not want the compiler to
simplify the operations into code sequences that can only be done
using the general-purpose register set.  Unfortunately, this is what
is currently happening.

Fortunately, it seems quite unlikely that copysign() will be
subsequently followed by other logical operations on the values
involved, so I think it is acceptable to use an unspec here.  This
allows us to preserve the operation in a form that allows the register
allocator to make the right choice later on, without limitation on the
final form of the operation (well, if we do end up using the gp
register bank, we get a dead constant load that we cannot easily
eliminate at a late stage).

	PR target/37369
	* config/aarch64/iterators.md (sizem1): Add sizes for SFmode and DFmode.
	(Vbtype): Add SFmode mapping.
	* config/aarch64/aarch64.md (copysigndf3, copysignsf3): Delete.
	(copysign<GPF:mode>3): New expand pattern.
	(copysign<GPF:mode>3_insn): New insn pattern.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.md
    trunk/gcc/config/aarch64/iterators.md
Comment 4 Richard Earnshaw 2019-04-30 09:26:02 UTC
Author: rearnsha
Date: Tue Apr 30 09:25:31 2019
New Revision: 270683

URL: https://gcc.gnu.org/viewcvs?rev=270683&root=gcc&view=rev
Log:
PR target/90075 Prefer bsl/bit/bif for copysignf. (backport GCC-8)

This patch is to fix the ICE caused in expand pattern of copysignf 
builtin. This is a back port to r267019 of trunk.

gcc:

2019-04-29  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	Backport from mainline
	2018-12-11  Richard Earnshaw <Richard.Earnshaw@arm.com>

	PR target/37369
	* config/aarch64/iterators.md (sizem1): Add sizes for
	SFmode and DFmode.
	(Vbtype): Add SFmode mapping.
	* config/aarch64/aarch64.md (copysigndf3, copysignsf3): Delete.
	(copysign<GPF:mode>3): New expand pattern.
	(copysign<GPF:mode>3_insn): New insn pattern.

testsuite:

2019-04-29  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/90075
	* gcc.target/aarch64/pr90075.c: New test.


Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.target/aarch64/pr90075.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/config/aarch64/aarch64.md
    branches/gcc-8-branch/gcc/config/aarch64/iterators.md
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
Comment 5 Richard Earnshaw 2019-04-30 09:31:35 UTC
Author: rearnsha
Date: Tue Apr 30 09:31:04 2019
New Revision: 270684

URL: https://gcc.gnu.org/viewcvs?rev=270684&root=gcc&view=rev
Log:
PR target/90075 Prefer bsl/bit/bif for copysignf. (backport GCC-7)

This patch is to fix the ICE caused by expand pattern of copysignf 
builtin. This is a back port to r267019 of trunk.

gcc:

2019-04-30  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/90075
	* config/aarch64/iterators.md (V_INT_EQUIV): Add mode for
	integer equivalent of floating point values.

	Backport from mainline
	2018-12-11  Richard Earnshaw  <Richard.Earnshaw@arm.com>

	PR target/37369
	* config/aarch64/iterators.md (sizem1): Add sizes for
	SFmode and DFmode.
	(Vbtype): Add SFmode mapping.
	* config/aarch64/aarch64.md (copysigndf3, copysignsf3): Delete.
	(copysign<GPF:mode>3): New expand pattern.
	(copysign<GPF:mode>3_insn): New insn pattern.

testsuite:

2019-04-30  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/90075
	* gcc.target/aarch64/pr90075.c: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.target/aarch64/pr90075.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/config/aarch64/aarch64.md
    branches/gcc-7-branch/gcc/config/aarch64/iterators.md
    branches/gcc-7-branch/gcc/testsuite/ChangeLog