[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-12-02 Thread via cfe-commits
macurtis-amd wrote: (Sorry for the delayed response ... was on Thanksgiving holiday) @banach-space @DavidTruby Thanks for looking at this! Latest version of the fix simply adds `-ffixed-form` for pre-processed input, unless the user manually specifies `-ffixed-form` or `-ffree-form`. https://

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-12-02 Thread via cfe-commits
https://github.com/macurtis-amd updated https://github.com/llvm/llvm-project/pull/117563 >From 2b61143e7bac96ee01cfbded4a26ac8206d6b247 Mon Sep 17 00:00:00 2001 From: Matthew Curtis Date: Mon, 2 Dec 2024 07:16:28 -0600 Subject: [PATCH] [flang] Treat pre-processed input as fixed --- clang/lib/

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-27 Thread David Truby via cfe-commits
DavidTruby wrote: I'm not sure if it's explicitly documented anywhere but there's a lot of tests, as you can see in the patch that introduced the behaviour here: https://reviews.llvm.org/D106727 Essentially since that patch the output is _always_ valid 72 width fixed form, and if the input wa

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-27 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > flang -E is already consistent here, it always produces fixed form output. It would be good to document and to test that - perhaps that's already the case? > So I think we can just teach flang -fc1 that '.i' Agreed, and this should be trivial to implement. Thanks @DavidT

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-27 Thread David Truby via cfe-commits
DavidTruby wrote: Thanks for the info on -save-temps, I understand it a little better now ! > we could simplify by requiring that flang -E always produces free-form output. flang -E is already consistent here, it always produces fixed form output. So I think we can just teach flang -fc1 that '

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-27 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > However, -save-temps doesn't appear to work for me at all. You need to add -fno-integrated-as. This is a known limitation: * [save-temps.f90](https://github.com/llvm/llvm-project/blob/main/flang/test/Driver/save-temps.f90) >It feels wrong that -save-temps runs the prepro

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-26 Thread David Truby via cfe-commits
DavidTruby wrote: `-save-temps` doesn't appear to work for me at all, I get the following error: ``` "S:\\llvm-project\\build\\bin\\flang.exe" -cc1as -triple x86_64-pc-windows-msvc19.41.34123 -filetype obj -main-file-name test.f90 -target-cpu x86-64 "-fdebug-compilation-dir=S:\\llvm-project\\b

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-26 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: ``` if ( (a .eq. 0) .and.(b. eq. 1)) then ``` It seems like something in [9fb2db1](https://github.com/llvm/llvm-project/commit/9fb2db1e1f42ae10a9d8c1d9410b5f4e719fdac0) has caused a space to appear between `.` and `eq`. Should we be looking at what that commit did mo

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-26 Thread via cfe-commits
macurtis-amd wrote: Thanks @banach-space and @DavidTruby for looking at this. > banach-space: Adding new types to > [Types.def](https://github.com/llvm/llvm-project/pull/117563/files#diff-b2abf750cadedc6109158e6f82b66abfaabd7c7c86c650d2a5163dc3e5fc44a7) > is a fairly huge design update. I'm no

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-25 Thread David Truby via cfe-commits
DavidTruby wrote: Thanks for the fix, I'd like to understand what the bug is better though; what is the difference between the proposed `flang -fc1 -x f95-fixed` and the existing `flang -fc1 -ffixed-form`? In the test case in here I already don't see an error with `flang -fc1 -ffixed-form`, i

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-25 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Adding new types to [Types.def](https://github.com/llvm/llvm-project/pull/117563/files#diff-b2abf750cadedc6109158e6f82b66abfaabd7c7c86c650d2a5163dc3e5fc44a7) is a fairly huge design update. I'm not saying this is approach is incorrect, but it definitely deserves a bit of d

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang Author: None (macurtis-amd) Changes Fixes an issue introduced by 9fb2db1e1f42 [flang] Retain spaces when preprocessing fixed-form source Where flang -fc1 fails to parse preprocessor output because it now remain

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: None (macurtis-amd) Changes Fixes an issue introduced by 9fb2db1e1f42 [flang] Retain spaces when preprocessing fixed-form source Where flang -fc1 fails to parse preprocessor output because it now remains in fixed form. --- Full

[clang] [flang] [flang] Preserve fixed form in fc1 -x value (PR #117563)

2024-11-25 Thread via cfe-commits
https://github.com/macurtis-amd created https://github.com/llvm/llvm-project/pull/117563 Fixes an issue introduced by 9fb2db1e1f42 [flang] Retain spaces when preprocessing fixed-form source Where flang -fc1 fails to parse preprocessor output because it now remains in fixed form. >From 9968