Bug ID: 85397
           Summary: -mcet -fcf-protection doesn't work with label in
                    nested function
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot
          Reporter: at gmail dot com
                CC: igor.v.tsimbalist at intel dot com
            Blocks: 81652
  Target Milestone: ---
            Target: x86_64

[hjl@gnu-cet-1 cet-3]$ cat x.i
s(int i)
      __label__ l1;
      int f(int i)
            goto l1;
          return 0;
      return f(i);
  return 1;

  return s(0)==1&&s(1)==0&&s(2)==1;
  return 0;
[hjl@gnu-cet-1 cet-3]$ make
gcc -O2 -mcet -fcf-protection -S x.i
gcc -g -O2 -mcet -fcf-protection -o x x.s
make: *** [Makefile:10: all] Segmentation fault
[hjl@gnu-cet-1 cet-3]$ gdb x
GNU gdb (GDB) Fedora 8.1-11.fc28
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from x...done.
(gdb) r
Starting program: /export/home/hjl/bugs/gcc/cet-3/x 
Missing separate debuginfos, use: dnf debuginfo-install

Program received signal SIGSEGV, Segmentation fault.
s () at x.s:76
76              ret
(gdb) bt
#0  s () at x.s:76
#1  0x0000000000401238 in x () at x.s:136
#2  0x000000000040106d in main () at x.s:157

Referenced Bugs:
[Bug 81652] [meta-bug] -fcf-protection=full -mcet bugs

Reply via email to