This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR optimization/12085


> This is runtime undefined behavior (if the function that ends up getting
> called at runtime has type incompatible with that used for the call), not
> compile-time.  So it should be a warning (not pedwarn), optionally with a
> trap generated (as for va_arg on bad types); only an error if you can
> prove that all possible executions of the program must execute the bad
> code.

Thanks for the clarification.

Since the check must be performed by the front-end, I'll need to propagate 
the result to the tree-inliner, and to the RTL expander to generate a trap.  
Would it be possible to define a new flag for CALL_EXPR?

The other solution I see is to directly build a CALL_EXPR to __builtin_trap 
in the front-end.  However, there is a problem when the return value of the 
call is used, because __builtin_trap returns void.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]