[Bug driver/32528] -save-temps when compiling standard input fails

2021-09-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-03-16 00:00:00 |2021-9-1

--- Comment #10 from Andrew Pinski  ---
Still  fails on the trunk:
apinski@xeond:~/src/upstream-gcc$ echo "int main(void){}" |
~/upstream-gcc/bin/gcc -xc  -save-temps - -c
cc1: error: unrecognized command-line option ā€˜-.iā€™


Note without the -c, it works as the output is based on a.out so it is a--.i
now.

[Bug driver/32528] -save-temps when compiling standard input fails

2017-12-16 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32528

--- Comment #9 from Eric Gallager  ---
(In reply to Paolo Bonzini from comment #7)
> re. comment #5, like this?
> 
> Index: gcc.c
> ===
> --- gcc.c   (revision 128902)
> +++ gcc.c   (working copy)
> @@ -4685,6 +4685,8 @@ do_spec_1 (const char *spec, int inswitc
> fatal ("spec '%s' invalid", spec);
>  
>   case 'b':
> +   if (!IS_ABSOLUTE_PATH (input_basename[0]) && input_basename[0] == 
> '-')
> + obstack_grow (, "./", 2);
> obstack_grow (, input_basename, basename_length);
> arg_going = 1;
> break;
> 
> Anybody wants to bootstrap/test/regtest this?
> Paolo

Try sending it to the gcc-patches to see if anyone can test it. I'd try the
patch myself, but bootstrap is currently broken for me.