Bug 1253822 - segmentation fault
segmentation fault
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
24
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-14 15:39 EDT by Sami Farin
Modified: 2016-03-10 10:04 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-10 10:04:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 67222 None None None Never

  None (edit)
Description Sami Farin 2015-08-14 15:39:57 EDT
Description of problem:
compiling this with -O1 or greater optimization level causes segfault.  I found this at /tmp after some ./configure executed tests..

int main(void){ posix_memalign(); }

mema.c: In function ‘main’:
mema.c:1:17: warning: implicit declaration of function ‘posix_memalign’ [-Wimplicit-function-declaration]
 int main(void){ posix_memalign(); }
                 ^
mema.c:1:5: internal compiler error: Segmentation fault
 int main(void){ posix_memalign(); }
     ^

Version-Release number of selected component (if applicable):
gcc version 5.2.1 20150716 (Red Hat 5.2.1-1) (GCC) 

How reproducible:
100%

Steps to Reproduce:
1. gcc -c mema.c -O1
2.
3.

Actual results:
segmentation fault

Expected results:
no such things, please

Additional info:
Comment 1 Marek Polacek 2015-08-14 16:32:18 EDT
D'oh.  Happens with GCC mainline as well; I filed this as PR67222.
Comment 2 Marek Polacek 2015-08-18 09:44:06 EDT
Fixed on trunk with

Author: mpolacek
Date: Tue Aug 18 13:41:27 2015
New Revision: 226969

URL: https://gcc.gnu.org/viewcvs?rev=226969&root=gcc&view=rev
Log:
	PR middle-end/67222
	* gimple-low.c (lower_stmt): Don't lower BUILT_IN_POSIX_MEMALIGN
	if the call isn't valid.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Check builtins using
	gimple_call_builtin_p.
	(call_may_clobber_ref_p_1): Likewise.
	(stmt_kills_ref_p): Likewise.

	* gcc.dg/torture/pr67222.c: New test.

Will backport to 5 soon.
Comment 3 Marek Polacek 2015-09-17 08:51:43 EDT
I realized I forgot to commit the fix to the gcc-5 branch.  I've done so now.
Comment 4 Jan Kurik 2016-02-24 10:41:59 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 5 Marek Polacek 2016-03-10 10:04:22 EST
Fixed in F23+.

Note You need to log in before you can comment on or make changes to this bug.