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


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

Re: Some patches for the C/C++ frontends


>>>>> Bernd Schmidt <bernds@cygnus.co.uk> writes:

 >  - The C++ frontend apparently uses a different prototype for
 >  __builtin_apply.  Resolved by using the C one, as that one seems
 >  correct.  Does __builtin_apply work at all for C++?  If not, there's no
 >  point in declaring it.

I would expect it to work the same way it does for C.  The C version is
almost certainly correct.

 >  - __builtin_return has a small difference: the function type is passed
 >  through build_exception_variant in the C++ frontend.  This difference
 >  is not present in the patch; if necessary, it can be resolved by moving
 >  this builtin out of the common code.

That call tells the compiler that the function will never throw an
exception.  I don't know why it would be done for __builtin_return, which
doesn't involve a call.  This could reasonably be done to builtins which
do get called, though.

This change is fine.

 >  - The C frontend allows some functions (abort, exit, _exit) to be
 >  called with any parameters.  The C++ frontend is more strict about the
 >  correct prototype.  This behaviour is preserved with the patch.

Good.

 >  - The C++ frontend wants to set DECL_BUILT_IN_NONANSI for abort and exit.
 >    It's not clear why.  The behaviour is preserved with the patch.

I dunno.  Try removing that difference and see if anything breaks.

 >  - The C++ frontend passes NULL_PTR as last argument when building
 >    builtin_fsqrt, the C frontend passes "sqrt".  Not sure whether that has
 >    a purpose (no comments to that effect); I used the C version.
 >    Likewise for memset.

That seems correct.

 >  - The C++ frontend doesn't know __builtin_trap.  I didn't change that yet.

Please do.  I imagine this is just a sync failure.

Jason


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