https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104822
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine, I think this patch will fix the issue:
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index f1a1752782a..43b9793e339 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -7480,6 +7480,7 @@ convert_for_assignment (location_t location, location_t
expr_loc, tree type,
/* See if the pointers point to incompatible scalar storage orders. */
if (warn_scalar_storage_order
+ && !null_pointer_constant_p (rhs)
&& (AGGREGATE_TYPE_P (ttl) && TYPE_REVERSE_STORAGE_ORDER (ttl))
!= (AGGREGATE_TYPE_P (ttr) && TYPE_REVERSE_STORAGE_ORDER (ttr)))
{