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: C++ PATCH for c++/39480


Richard Guenther wrote:
+         if (!(optimize && flag_tree_ter))
+           {
+             /* When TER is off get_pointer_alignment returns 0, so a call
+                to __builtin_memcpy is expanded as a call to memcpy, which
+                is invalid with identical args.  When TER is on it is
+                expanded as a block move, which should be safe.  */

This reasoning is not entirely clear to me (that is, it looks fragile to
rely on TER doing anything).

I'm not relying on TER doing anything, just mirroring the logic in get_pointer_alignment so that we add this test in the exact same situations that expand_builtin_memcpy gives up and returns NULL.


Also some targets may prefer the libcall if optimizing for size, no?

Then that's a bug in expand_block_move_hints, not the C++ front end.


Jason


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