view gcc/testsuite/gcc.dg/pr84131.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

/* PR 94131 - ICE on printf with a VLA string and -fno-tree-ccp
   -fno-tree-forwprop
   { dg-do compile }
   { dg-options "-O1 -fno-tree-ccp -fno-tree-forwprop" } */

void rv1 (int n)
{
  char a[n];
  __INTPTR_TYPE__ i = (__INTPTR_TYPE__ )&a[0];
  i &= 3;

  __builtin_memset (a, '\0', sizeof a);
  __builtin_printf ("%s", i ? &a[0] : "");
}


void sink (void*);

void rv2 (int n)
{
  char a[n];
  __INTPTR_TYPE__ i = (__INTPTR_TYPE__)&a[0];
  i &= 3;

  __builtin_memset (a, '\0', sizeof a);
  __builtin_printf ("%s", i ? &a[0] : "");

  sink (a);
}