From: David Wohlferd Date: Mon, 8 Dec 2014 21:58:23 +0000 (+0000) Subject: re PR inline-asm/61692 (ICE in extract_insn in recog.c for asm with many parameters) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c475c36cf6ed17727379ed04418557fcdcc9c0ed;p=gcc.git re PR inline-asm/61692 (ICE in extract_insn in recog.c for asm with many parameters) PR target/61692 * cfgexpand.c (expand_asm_operands): Count all inline asm params. PR target/61692 * gcc.dg/pr61692.c: New test. From-SVN: r218494 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e4306d8b0a..c44fce6bc91 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-15 David Wohlferd + + PR target/61692 + * cfgexpand.c (expand_asm_operands): Count all inline asm params. + 2014-12-08 David Malcolm PR jit/63854 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index c99631708df..d85dbca659c 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2594,7 +2594,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs, } ninputs += ninout; - if (ninputs + noutputs > MAX_RECOG_OPERANDS) + if (ninputs + noutputs + nlabels > MAX_RECOG_OPERANDS) { error ("more than %d operands in %", MAX_RECOG_OPERANDS); return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f47cfccdfaf..79963a7e3ea 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-11-15 David Wohlferd + + PR target/61692 + * gcc.dg/pr61692.c: New test. + 2014-12-08 Bernd Edlinger PR ipa/64049 diff --git a/gcc/testsuite/gcc.dg/pr61692.c b/gcc/testsuite/gcc.dg/pr61692.c new file mode 100644 index 00000000000..1b619bd7535 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr61692.c @@ -0,0 +1,174 @@ +/* PR 61692 */ +/* { dg-do compile } */ + +/* Check for ice when exceededing the max # + of parameters to inline asm. */ + +int Labels() +{ + label01: label02: label03: label04: label05: + label06: label07: label08: label09: label10: + label11: label12: label13: label14: label15: + label16: label17: label18: label19: label20: + label21: label22: label23: label24: label25: + label26: label27: label28: label29: label30: + label31: + + __asm__ goto ("" /* Works. */ + : /* no outputs */ + : /* no inputs */ + : /* no clobbers */ + : label01, label02, label03, label04, label05, + label06, label07, label08, label09, label10, + label11, label12, label13, label14, label15, + label16, label17, label18, label19, label20, + label21, label22, label23, label24, label25, + label26, label27, label28, label29, label30); + + __asm__ goto ("" /* { dg-error "more than 30 operands" } */ + : /* no outputs */ + : /* no inputs */ + : /* no clobbers */ + : label01, label02, label03, label04, label05, + label06, label07, label08, label09, label10, + label11, label12, label13, label14, label15, + label16, label17, label18, label19, label20, + label21, label22, label23, label24, label25, + label26, label27, label28, label29, label30, + label31); + + return 0; +} + +int Labels_and_Inputs() +{ + int b01, b02, b03, b04, b05, b06, b07, b08, b09, b10; + int b11, b12, b13, b14, b15, b16, b17, b18, b19, b20; + int b21, b22, b23, b24, b25, b26, b27, b28, b29, b30; + int b31; + + label01: label02: label03: label04: label05: + label06: label07: label08: label09: label10: + label11: label12: label13: label14: label15: + label16: label17: label18: label19: label20: + label21: label22: label23: label24: label25: + label26: label27: label28: label29: label30: + label31: + + b01 = b02 = b03 = b04 = b05 = b06 = b07 = b08 = b09 = b10 = 0; + b11 = b12 = b13 = b14 = b15 = b16 = b17 = b18 = b19 = b20 = 0; + b21 = b22 = b23 = b24 = b25 = b26 = b27 = b28 = b29 = b30 = 0; + b31 = 0; + + __asm__ goto ("" /* Works. */ + : /* no outputs */ + : "m" (b01), "m" (b02), "m" (b03), "m" (b04), "m" (b05), + "m" (b06), "m" (b07), "m" (b08), "m" (b09), "m" (b10), + "m" (b11), "m" (b12), "m" (b13), "m" (b14), "m" (b15), + "m" (b16), "m" (b17), "m" (b18), "m" (b19), "m" (b20), + "m" (b21), "m" (b22), "m" (b23), "m" (b24), "m" (b25), + "m" (b26), "m" (b27), "m" (b28), "m" (b29) + : /* no clobbers */ + : label01); + + __asm__ goto ("" /* { dg-error "more than 30 operands" } */ + : /* no outputs */ + : "m" (b01), "m" (b02), "m" (b03), "m" (b04), "m" (b05), + "m" (b06), "m" (b07), "m" (b08), "m" (b09), "m" (b10), + "m" (b11), "m" (b12), "m" (b13), "m" (b14), "m" (b15), + "m" (b16), "m" (b17), "m" (b18), "m" (b19), "m" (b20), + "m" (b21), "m" (b22), "m" (b23), "m" (b24), "m" (b25), + "m" (b26), "m" (b27), "m" (b28), "m" (b29), "m" (b30) + : /* no clobbers */ + : label01); + + return 0; +} + +int Outputs() +{ + int b01, b02, b03, b04, b05, b06, b07, b08, b09, b10; + int b11, b12, b13, b14, b15, b16, b17, b18, b19, b20; + int b21, b22, b23, b24, b25, b26, b27, b28, b29, b30; + int b31; + + /* Outputs. */ + __asm__ volatile ("" /* Works. */ + : "=m" (b01), "=m" (b02), "=m" (b03), "=m" (b04), "=m" (b05), + "=m" (b06), "=m" (b07), "=m" (b08), "=m" (b09), "=m" (b10), + "=m" (b11), "=m" (b12), "=m" (b13), "=m" (b14), "=m" (b15), + "=m" (b16), "=m" (b17), "=m" (b18), "=m" (b19), "=m" (b20), + "=m" (b21), "=m" (b22), "=m" (b23), "=m" (b24), "=m" (b25), + "=m" (b26), "=m" (b27), "=m" (b28), "=m" (b29), "=m" (b30)); + + __asm__ volatile ("" /* { dg-error "more than 30 operands" } */ + : "=m" (b01), "=m" (b02), "=m" (b03), "=m" (b04), "=m" (b05), + "=m" (b06), "=m" (b07), "=m" (b08), "=m" (b09), "=m" (b10), + "=m" (b11), "=m" (b12), "=m" (b13), "=m" (b14), "=m" (b15), + "=m" (b16), "=m" (b17), "=m" (b18), "=m" (b19), "=m" (b20), + "=m" (b21), "=m" (b22), "=m" (b23), "=m" (b24), "=m" (b25), + "=m" (b26), "=m" (b27), "=m" (b28), "=m" (b29), "=m" (b30), + "=m" (b31)); + + return 0; +} + +int Inputs() +{ + int b01, b02, b03, b04, b05, b06, b07, b08, b09, b10; + int b11, b12, b13, b14, b15, b16, b17, b18, b19, b20; + int b21, b22, b23, b24, b25, b26, b27, b28, b29, b30; + int b31; + + b01 = b02 = b03 = b04 = b05 = b06 = b07 = b08 = b09 = b10 = 0; + b11 = b12 = b13 = b14 = b15 = b16 = b17 = b18 = b19 = b20 = 0; + b21 = b22 = b23 = b24 = b25 = b26 = b27 = b28 = b29 = b30 = 0; + b31 = 0; + + __asm__ volatile ("" /* Works. */ + : /* no outputs */ + : "m" (b01), "m" (b02), "m" (b03), "m" (b04), "m" (b05), + "m" (b06), "m" (b07), "m" (b08), "m" (b09), "m" (b10), + "m" (b11), "m" (b12), "m" (b13), "m" (b14), "m" (b15), + "m" (b16), "m" (b17), "m" (b18), "m" (b19), "m" (b20), + "m" (b21), "m" (b22), "m" (b23), "m" (b24), "m" (b25), + "m" (b26), "m" (b27), "m" (b28), "m" (b29), "m" (b30)); + + __asm__ volatile ("" /* { dg-error "more than 30 operands" } */ + : /* no outputs */ + : "m" (b01), "m" (b02), "m" (b03), "m" (b04), "m" (b05), + "m" (b06), "m" (b07), "m" (b08), "m" (b09), "m" (b10), + "m" (b11), "m" (b12), "m" (b13), "m" (b14), "m" (b15), + "m" (b16), "m" (b17), "m" (b18), "m" (b19), "m" (b20), + "m" (b21), "m" (b22), "m" (b23), "m" (b24), "m" (b25), + "m" (b26), "m" (b27), "m" (b28), "m" (b29), "m" (b30), + "m" (b31)); + + return 0; +} + +int Input_Output() +{ + int b01, b02, b03, b04, b05, b06, b07, b08, b09, b10; + int b11, b12, b13, b14, b15, b16, b17, b18, b19, b20; + int b21, b22, b23, b24, b25, b26, b27, b28, b29, b30; + int b31; + + b01 = b02 = b03 = b04 = b05 = b06 = b07 = b08 = b09 = b10 = 0; + b11 = b12 = b13 = b14 = b15 = b16 = b17 = b18 = b19 = b20 = 0; + b21 = b22 = b23 = b24 = b25 = b26 = b27 = b28 = b29 = b30 = 0; + b31 = 0; + + __asm__ volatile ("" /* Works. */ + : "+m" (b01), "+m" (b02), "+m" (b03), "+m" (b04), "+m" (b05), + "+m" (b06), "+m" (b07), "+m" (b08), "+m" (b09), "+m" (b10), + "+m" (b11), "+m" (b12), "+m" (b13), "+m" (b14), "+m" (b15)); + + __asm__ volatile ("" /* { dg-error "more than 30 operands" } */ + : "+m" (b01), "+m" (b02), "+m" (b03), "+m" (b04), "+m" (b05), + "+m" (b06), "+m" (b07), "+m" (b08), "+m" (b09), "+m" (b10), + "+m" (b11), "+m" (b12), "+m" (b13), "+m" (b14), "+m" (b15), + "+m" (b16)); + + return 0; +}