Originally noted in [Bug middle-end/19410], but seems to be a different problem (maybe front-end). RUN cxa4020 ==24948== Memcheck, a memory error detector for x86-linux. ==24948== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al. ==24948== Using valgrind-2.3.0.CVS, a program supervision framework for x86-linux. ==24948== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al. ==24948== For more details, rerun with: -v ==24948== ,.,. CXA4020 ACATS 2.5 05-01-11 17:13:16 ---- CXA4020 Check that the subprograms defined in package Ada.Strings.Wide_Bounded are available, and that they produce correct results, especially under conditions where truncation of the result is required. ==24948== Source and destination overlap in memcpy(0x52BFC8F8, 0x52BFC8FC, 8) ==24948== at 0x1B906AC5: memcpy (mac_replace_strmem.c:113) ==24948== by 0x805CABC: ada__strings__wide_superbounded__super_trim__4 (a-stwisu.adb:1664) ==24948== by 0x8068805: cxa4020__test_block__b10__trim__4.1007 (a-stwibo.ads:810) ==24948== by 0x806ABF6: _ada_cxa4020 (cxa4020.adb:396) ==24948== ==24948== Source and destination overlap in memcpy(0x52BFC8F8, 0x52BFC8FC, 12) ==24948== at 0x1B906AC5: memcpy (mac_replace_strmem.c:113) ==24948== by 0x805CABC: ada__strings__wide_superbounded__super_trim__4 (a-stwisu.adb:1664) ==24948== by 0x8068805: cxa4020__test_block__b10__trim__4.1007 (a-stwibo.ads:810) ==24948== by 0x806ACDC: _ada_cxa4020 (cxa4020.adb:411) ==24948== ==24948== Source and destination overlap in memcpy(0x52BFC8F8, 0x52BFC8FC, 12) ==24948== at 0x1B906AC5: memcpy (mac_replace_strmem.c:113) ==24948== by 0x805CABC: ada__strings__wide_superbounded__super_trim__4 (a-stwisu.adb:1664) ==24948== by 0x8068805: cxa4020__test_block__b10__trim__4.1007 (a-stwibo.ads:810) ==24948== by 0x806ADC2: _ada_cxa4020 (cxa4020.adb:422) ==24948== ==24948== Source and destination overlap in memcpy(0x52BFC8F8, 0x52BFC900, 10) ==24948== at 0x1B906AC5: memcpy (mac_replace_strmem.c:113) ==24948== by 0x805CABC: ada__strings__wide_superbounded__super_trim__4 (a-stwisu.adb:1664) ==24948== by 0x8068805: cxa4020__test_block__b10__trim__4.1007 (a-stwibo.ads:810) ==24948== by 0x806AEA8: _ada_cxa4020 (cxa4020.adb:433) ==== CXA4020 PASSED ============================. ==24948== ==24948== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 13 from 1) ==24948== malloc/free: in use at exit: 10280 bytes in 2 blocks. ==24948== malloc/free: 23 allocs, 21 frees, 12122 bytes allocated. ==24948== For a detailed leak analysis, rerun with: --leak-check=yes ==24948== For counts of detected errors, rerun with: -v PASS: cxa4020
-- Summary: ACATS CXA4009, CXA4020 - valgrind detects bad code (overlapping memcpy) Product: gcc Version: tree-ssa Status: UNCONFIRMED Severity: normal Priority: P2 Component: ada AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: baldrick at free dot fr CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19419