| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fno-stack-protector -save-temps" } */ |
| 3 |
|
| 4 |
#define ALIGN 16 |
| 5 |
#define EXTRA |
| 6 |
|
| 7 |
#include "bitfield-abi-warning.h" |
| 8 |
|
| 9 |
/* In f1, f2, f4, f8, f16, f16p (and stdarg versions): */ |
| 10 |
/* { dg-final { scan-assembler-times "and\tw0, w2, 1" 12 } } */ |
| 11 |
/* In fp, f1p, f2p, f4p, f8p (and stdarg versions): */ |
| 12 |
/* { dg-final { scan-assembler-times "and\tw0, w1, 1" 10 } } */ |
| 13 |
|
| 14 |
/* Bitfield parameter in registers. */ |
| 15 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 47 } f1 */ |
| 16 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 48 } f2 */ |
| 17 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 49 } f4 */ |
| 18 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 50 } f8 */ |
| 19 |
|
| 20 |
/* No change in parameter passing in GCC 9.1 nor GCC 13.1 for lines 53-57 (fp, |
| 21 |
f1p, f2p, f4p, f8p) because the argument fits in a single register. |
| 22 |
No warning expected. */ |
| 23 |
|
| 24 |
/* Bitfield call argument in registers. */ |
| 25 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 60 } g1 */ |
| 26 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 61 } g2 */ |
| 27 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 62 } g4 */ |
| 28 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 63 } g8 */ |
| 29 |
|
| 30 |
/* No change in parameter passing in GCC 9.1 for lines 66-70 (gp, g1p, g2p, |
| 31 |
g4p, g8p), no warning expected. */ |
| 32 |
|
| 33 |
|
| 34 |
/* Bitfield parameter in stack. */ |
| 35 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 74 } f1_stack */ |
| 36 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 75 } f2_stack */ |
| 37 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 76 } f4_stack */ |
| 38 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 77 } f8_stack */ |
| 39 |
|
| 40 |
/* { dg-note {parameter passing for argument of type 'struct Sp' changed in GCC 13.1} "" { target *-*-* } 80 } fp_stack */ |
| 41 |
/* { dg-note {parameter passing for argument of type 'struct S1p' changed in GCC 13.1} "" { target *-*-* } 81 } f1p_stack */ |
| 42 |
/* { dg-note {parameter passing for argument of type 'struct S2p' changed in GCC 13.1} "" { target *-*-* } 82 } f2p_stack */ |
| 43 |
/* { dg-note {parameter passing for argument of type 'struct S4p' changed in GCC 13.1} "" { target *-*-* } 83 } f4p_stack */ |
| 44 |
/* { dg-note {parameter passing for argument of type 'struct S8p' changed in GCC 13.1} "" { target *-*-* } 84 } f8p_stack */ |
| 45 |
|
| 46 |
/* Bitfield call argument in stack. */ |
| 47 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 87 } g1_stack */ |
| 48 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 88 } g2_stack */ |
| 49 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 89 } g4_stack */ |
| 50 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 90 } g8_stack */ |
| 51 |
|
| 52 |
/* { dg-note {parameter passing for argument of type 'struct Sp' changed in GCC 13.1} "" { target *-*-* } 93 } gp_stack */ |
| 53 |
/* { dg-note {parameter passing for argument of type 'struct S1p' changed in GCC 13.1} "" { target *-*-* } 94 } g1p_stack */ |
| 54 |
/* { dg-note {parameter passing for argument of type 'struct S2p' changed in GCC 13.1} "" { target *-*-* } 95 } g2p_stack */ |
| 55 |
/* { dg-note {parameter passing for argument of type 'struct S4p' changed in GCC 13.1} "" { target *-*-* } 96 } g4p_stack */ |
| 56 |
/* { dg-note {parameter passing for argument of type 'struct S8p' changed in GCC 13.1} "" { target *-*-* } 97 } g8p_stack */ |
| 57 |
|
| 58 |
|
| 59 |
/* Bitfield parameter in stdarg. */ |
| 60 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 101 } f1_stdarg */ |
| 61 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 102 } f2_stdarg */ |
| 62 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 103 } f4_stdarg */ |
| 63 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 104 } f8_stdarg */ |
| 64 |
|
| 65 |
/* Parameter passing for these should not have changed in GCC 9.1 (PR 105549). |
| 66 |
Fortunately we warn. Note the discrepancy with lines 120-124 below: we warn |
| 67 |
in the callee, but not in the caller. */ |
| 68 |
/* { dg-note {parameter passing for argument of type 'struct Sp' changed in GCC 13.1} "" { target *-*-* } 107 } fp_stdarg */ |
| 69 |
/* { dg-note {parameter passing for argument of type 'struct S1p' changed in GCC 13.1} "" { target *-*-* } 108 } f1p_stdarg */ |
| 70 |
/* { dg-note {parameter passing for argument of type 'struct S2p' changed in GCC 13.1} "" { target *-*-* } 109 } f2p_stdarg */ |
| 71 |
/* { dg-note {parameter passing for argument of type 'struct S4p' changed in GCC 13.1} "" { target *-*-* } 110 } f4p_stdarg */ |
| 72 |
/* { dg-note {parameter passing for argument of type 'struct S8p' changed in GCC 13.1} "" { target *-*-* } 111 } f8p_stdarg */ |
| 73 |
|
| 74 |
/* Bitfield call argument in stdarg. */ |
| 75 |
/* { dg-note {parameter passing for argument of type 'struct S1' changed in GCC 9.1} "" { target *-*-* } 114 } g1_stdarg */ |
| 76 |
/* { dg-note {parameter passing for argument of type 'struct S2' changed in GCC 9.1} "" { target *-*-* } 115 } g2_stdarg */ |
| 77 |
/* { dg-note {parameter passing for argument of type 'struct S4' changed in GCC 9.1} "" { target *-*-* } 116 } g4_stdarg */ |
| 78 |
/* { dg-note {parameter passing for argument of type 'struct S8' changed in GCC 9.1} "" { target *-*-* } 117 } g8_stdarg */ |
| 79 |
|
| 80 |
/* No change in parameter passing in GCC 9.1 for lines 120-124 (gp_stdarg |
| 81 |
g1p_stdarg, g2p_stdarg, g4p_stdarg, g8p_stdarg), no warning expected. */ |