public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94300] New: [10 Regression] memcpy vector load miscompiled during const-prop
@ 2020-03-24 12:48 kretz at kde dot org
  2020-03-24 13:17 ` [Bug tree-optimization/94300] [10 Regression] memcpy vector load miscompiled during const-prop since r10-6809-g7f5617b00445dcc8 marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: kretz at kde dot org @ 2020-03-24 12:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94300
           Summary: [10 Regression] memcpy vector load miscompiled during
                    const-prop
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kretz at kde dot org
  Target Milestone: ---
            Target: x86_64-*-*, i?86-*-*

Test case `-O1 -march=skylake-avx512`:

int main()                                                                      
{                                                                               
  double mem[16];                                                               
  using V [[gnu::vector_size(64)]] = double;                                    
  const V a{0, 1, 2, 3, 4, 5, 6, 7};                                            
  const V b{8, 9, 10, 11, 12, 13, 14, 15};                                      
  __builtin_memcpy(mem, &a, 64);                                                
  __builtin_memcpy(mem + 8, &b, 64);                                            
  V c = {};                                                                     
  __builtin_memcpy(&c, mem + 4, 64);                                            
  if (c[5] != double(9))                                                        
    __builtin_abort();                                                          
}

>From my extended test case, where c would be {4, 5, 6, 7, 8, 15, 9, 10}. If GCC
is made to forget the contents of mem (e.g. inline-asm), the test does not
fail. GCC9 does not do constant evaluation of the code above and therefore
doesn't fail.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-25  8:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 12:48 [Bug tree-optimization/94300] New: [10 Regression] memcpy vector load miscompiled during const-prop kretz at kde dot org
2020-03-24 13:17 ` [Bug tree-optimization/94300] [10 Regression] memcpy vector load miscompiled during const-prop since r10-6809-g7f5617b00445dcc8 marxin at gcc dot gnu.org
2020-03-24 14:02 ` jakub at gcc dot gnu.org
2020-03-24 14:53 ` jakub at gcc dot gnu.org
2020-03-25  8:17 ` cvs-commit at gcc dot gnu.org
2020-03-25  8:22 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).