This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for PR c/57490
- From: Jason Merrill <jason at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Marek Polacek (polacek at redhat dot com)" <polacek at redhat dot com>
- Date: Mon, 19 Aug 2013 14:23:17 -0400
- Subject: Re: [PATCH] Fix for PR c/57490
- References: <BF230D13CA30DD48930C31D4099330003A43C80E at FMSMSX101 dot amr dot corp dot intel dot com> <BF230D13CA30DD48930C31D4099330003A43C87D at FMSMSX101 dot amr dot corp dot intel dot com> <20130701170926 dot GB2336 at tucnak dot redhat dot com> <BF230D13CA30DD48930C31D4099330003A43C8C0 at FMSMSX101 dot amr dot corp dot intel dot com> <yddhagcvwh0 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <ydda9ldisvi dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <yddtxizkrl0 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <BF230D13CA30DD48930C31D4099330003A458A6A at FMSMSX101 dot amr dot corp dot intel dot com> <520E6A65 dot 4010500 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A459B1F at FMSMSX101 dot amr dot corp dot intel dot com> <520F022F dot 20604 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A45A0C6 at FMSMSX101 dot amr dot corp dot intel dot com> <521222C4 dot 5080100 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A45A24A at FMSMSX101 dot amr dot corp dot intel dot com> <52122974 dot 2080606 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A45A2BB at FMSMSX101 dot amr dot corp dot intel dot com> <52122F97 dot 5070107 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A45A374 at FMSMSX101 dot amr dot corp dot int! el.com>
On 08/19/2013 12:40 PM, Iyer, Balaji V wrote:
+ /* If it is a built-in array notation function, then the return type of
+ the function is the element type of the array passed in as array
+ notation (i.e. the first parameter of the function). */
+ if (flag_enable_cilkplus && TREE_CODE (fn) == CALL_EXPR)
...
Let's move this a bit higher in the function, to...
/* Check that arguments to builtin functions match the expectations. */
if (fndecl
&& DECL_BUILT_IN (fndecl)
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& !check_builtin_function_arguments (fndecl, nargs, argarray))
return error_mark_node;
...here.
/* Some built-in function calls will be evaluated at compile-time in
fold (). Set optimize to 1 when folding __builtin_constant_p inside
a constexpr function so that fold_builtin_1 doesn't fold it to 0. */
OK with that change.
Jason