[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-03-05 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:febfe87d80c5bc8afd9038136ae7c09910a0d883

commit r10-7037-gfebfe87d80c5bc8afd9038136ae7c09910a0d883
Author: Jakub Jelinek 
Date:   Thu Mar 5 09:12:44 2020 +0100

print-rtl: Fix printing of CONST_STRING in DEBUG_INSNs [PR93399]

The following testcase fails to assemble, as CONST_STRING in the
DEBUG_INSNs
is printed as is, so if it contains \n and/or \r, we are in trouble:
.loc 1 14 3
# DEBUG haystack => [si]
# DEBUG needle => "
"
In the gimple dumps we print those (STRING_CSTs) as
  # DEBUG haystack => D#1
  # DEBUG needle => "\n"
so this patch uses what we use in tree printing for the CONST_STRINGs too.

2020-03-05  Jakub Jelinek  

PR middle-end/93399
* tree-pretty-print.h (pretty_print_string): Declare.
* tree-pretty-print.c (pretty_print_string): Remove forward
declaration, no longer static.  Change nbytes parameter type
from unsigned to size_t.
* print-rtl.c (print_value) : Use
pretty_print_string and for shrink way too long strings.

* gcc.dg/pr93399.c: New test.

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-03-04 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Created attachment 47969
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47969=edit
gcc10-pr93399.patch

Untested fix.  This function is what we use in the gimple dumps for the
DEBUG_STMTs with STRING_CST values.

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-03-04 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.4 |8.5

--- Comment #6 from Jakub Jelinek  ---
GCC 8.4.0 has been released, adjusting target milestone.

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-01-27 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

--- Comment #5 from Alexandre Oliva  ---
I suppose it would make sense for str_pattern_slim to quote line breaks
and other active characters when printing out string literals.  And
perhaps to eliminate one more use of str_pattern_slim while at that...

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-01-23 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

--- Comment #4 from Andrew Pinski  ---
dwarf2out.c:27492 or so
in dwarf2out_var_location.

I think ...
Here is a reduced testcase without any headers:
extern __inline __attribute__ ((__always_inline__)) __attribute__
((__gnu_inline__)) char *
strstr (char *__haystack, const char *__needle) throw ()
{
  return __builtin_strstr (__haystack, __needle);
}

int main(int argc, char** argv) {
  char* substr = strstr(argv[0], "\n");
  char* another = strstr(argv[0], "\r\n");
  return 0;
}

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-01-23 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

Andrew Pinski  changed:

   What|Removed |Added

 Target|x86_64-*-*  |

--- Comment #3 from Andrew Pinski  ---
// DEBUG __needle => "
"
Is the first issue.

NOTE my testing is on aarch64-linux-gnu which uses // as the comment marker;
rather than #.

[Bug middle-end/93399] [8/9/10 Regression] Annotate assembler option failure

2020-01-23 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93399

--- Comment #2 from Marek Polacek  ---
The error I see is:

/tmp/ccmVatwF.s: Assembler messages:
/tmp/ccmVatwF.s:90: Error: invalid character (0xa) in mnemonic
/tmp/ccmVatwF.s:92: Error: unassigned file number 2
/tmp/ccmVatwF.s:92: Error: junk at end of line, first unrecognized character is
`3'
/tmp/ccmVatwF.s:99: Error: invalid character (0xa) in mnemonic
/tmp/ccmVatwF.s:101: Error: unassigned file number 3
/tmp/ccmVatwF.s:101: Error: junk at end of line, first unrecognized character
is `2'
/tmp/ccmVatwF.s:120: Error: unassigned file number 3
/tmp/ccmVatwF.s:120: Error: junk at end of line, first unrecognized character
is `2'
/tmp/ccmVatwF.s: Error: unassigned file number 2
/tmp/ccmVatwF.s: Error: unassigned file number 3
/tmp/ccmVatwF.s:6287: Error: can't resolve `.text.startup' {.text.startup
section} - `.LFB2035' {*UND* section}
/tmp/ccmVatwF.s:6358: Error: can't resolve `.LFE1554' {*UND* section} -
`.LFB1554' {.text.startup section}
/tmp/ccmVatwF.s:8073: Error: can't resolve `.LFE1554' {*UND* section} -
`.LFB1554' {.text.startup section}
/tmp/ccmVatwF.s:8075: Error: can't resolve `.text.startup' {.text.startup
section} - `.LFB2035' {*UND* section}
/tmp/ccmVatwF.s: Error: .size expression for _GLOBAL__sub_I_main does not
evaluate to a constant

Broke somewhere between GCC 7 and 8.