Bug 48731 - regression: __attribute__((flatten)) produces error with function calling variadic functions
Summary: regression: __attribute__((flatten)) produces error with function calling var...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.1
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 19:10 UTC by Florent Bruneau
Modified: 2011-04-26 13:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-04-23 09:13:41


Attachments
preprocessed example source (300 bytes, application/octet-stream)
2011-04-22 19:10 UTC, Florent Bruneau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florent Bruneau 2011-04-22 19:10:15 UTC
Created attachment 24075 [details]
preprocessed example source

Function with the flatten attribute that call variadic function do not compile anymore with gcc-4.6. It worked perfectly with gcc-4.5. The attachment provide a simple example of code.

Compilation flag:
% gcc-4.6 -std=gnu99 --save-temp -O3 -c flatten_variadic.c

Resulting error:
flatten_variadic.c: In function ‘blah2’:
flatten_variadic.c:5:23: error: ‘va_start’ used in function with fixed args

GCC: gcc-4.6 (Debian 4.6.0-4) 4.6.1 20110419 (prerelease)
System: Debian: Linux edelzwicker 2.6.38-2-amd64 #1 SMP Thu Apr 7 04:28:07 UTC 2011 x86_64 GNU/Linux
Comment 1 Richard Biener 2011-04-23 09:13:41 UTC
I will have a look.
Comment 2 Richard Biener 2011-04-26 12:59:33 UTC
Author: rguenth
Date: Tue Apr 26 12:59:22 2011
New Revision: 172963

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172963
Log:
2011-04-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/48731
	* ipa-inline.c (cgraph_flatten): Test if function is inlinable.

	* gcc.dg/torture/pr48731.c: New testcase.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr48731.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/ipa-inline.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 3 Richard Biener 2011-04-26 13:00:58 UTC
Author: rguenth
Date: Tue Apr 26 13:00:53 2011
New Revision: 172964

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172964
Log:
2011-04-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/48731
	* gcc.dg/torture/pr48731.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr48731.c
Modified:
    trunk/gcc/testsuite/ChangeLog
Comment 4 Richard Biener 2011-04-26 13:01:55 UTC
Fixed.