https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77709

            Bug ID: 77709
           Summary: specified destination size warning does not work when
                    cross-compiling from 64 host to 32bit target
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thopre01 at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu
            Target: arm-none-eabi

Hi,

gcc.dg/tree-ssa/builtin-sprintf-warn-1.c is failing on an arm-none-eabi GCC
cross-compiler on x86_64-linux-gnu machine because the following warning are
missing:

FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-1.c  (test for warnings, line 1222)
FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-1.c  (test for warnings, line 1272)
FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-1.c  (test for warnings, line 1383)

I believe the reason is that -1 would create a MAX_UINT on a 32bit target which
would be smaller than an HOST_WIDE_INT_MAX of the 64bit host so the following
test would fail:

          if (dstsize >= HOST_WIDE_INT_MAX)
            warning_at (gimple_location (info.callstmt), OPT_Wformat_length_,
                        "specified destination size %wu too large",
                        dstsize);

I'm not sure if the fault lies in the gimple code or the testsuite though.

Reply via email to