This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/61886] [4.8/4.9/5 Regression] LTO breaks fread with _FORTIFY_SOURCE=2
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Oct 2014 07:23:18 +0000
- Subject: [Bug lto/61886] [4.8/4.9/5 Regression] LTO breaks fread with _FORTIFY_SOURCE=2
- Auto-submitted: auto-generated
- References: <bug-61886-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61886
--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 6 Oct 2014, hubicka at ucw dot cz wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61886
>
> --- Comment #11 from Jan Hubicka <hubicka at ucw dot cz> ---
> Hi,
> this patch implements the lowring. Each call with warn attribute triggers code
> in cgraphunit that inserts call to bulitin_warning/error that is output at
> expansion time.
>
> Do we have way to define bulitin that is not user accessible?
>
> Also we do not have way to define LOOPING_CONST bulitin, so I am simply forcing
> the flag in cgraphunit.c that is somewhat ugly.
But this also means that when attaching the attribute to pure/const
functions which result becomes unused and thus the call gets DCEd
will still emit the warning/error. Similar if the function gets
inlined (formerly no warning/error).
I think you need an alternate lowering for the first case at least,
like passing through the return value. Not sure how to deal with the 2nd
case.
That said, I don't think this is the way to go to implement the
attribute.