This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question on inconsistent generated codes for builtin calls
On Mon, Jan 16, 2012 at 7:24 AM, Amker.Cheng <amker.cheng@gmail.com> wrote:
> On Fri, Jan 13, 2012 at 10:17 PM, Amker.Cheng <amker.cheng@gmail.com> wrote:
>> On Fri, Jan 13, 2012 at 5:33 PM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>>
>>> No, I think the check is superfluous and should be removed. ?I also wonder
>>> why we exempt BUILT_IN_FREE here ... can you dig in SVN history a bit?
>>> For both things?
>
> Hi Richard,
> The BUILT_IN_FREE was introduced in r138362 fixing PR36970,
> in which gcc did not give warning on freeing non-heap memory, as in program:
>
> main ()
> {
> ? ? char array[100];
> ? ? free (array);
> }
I see. Later down we'll expand it directly anyway, thus it seems to be
just bad obfuscated coding (warning at expansion time should be
separated from expansion itself).
> I will run make check to see whether it's ok we do not check
> DECL_ASSEMBLER_NAME_SET_P and send a patch then.
Thanks.
> BTW, should I create a bug for this?
Yes.
Thanks,
Richard.
> Thanks.