Giter Site home page Giter Site logo

flang-compiler / clang Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 12.0 260.39 MB

License: Other

CMake 0.11% Objective-C 6.94% C++ 69.91% C 19.90% Python 0.56% Objective-C++ 2.13% MATLAB 0.07% Mercury 0.01% LLVM 0.01% Assembly 0.05% Rust 0.01% Cuda 0.29% Mathematica 0.01% Roff 0.01% Shell 0.01% M 0.01% Fortran 0.01% Limbo 0.01% RenderScript 0.01% Forth 0.01%

clang's People

Contributors

aaronballman avatar akyrtzi avatar alexey-bataev avatar annazaks avatar atoker avatar chandlerc avatar chapuni avatar d0k avatar ddunbar avatar djasper avatar douggregor avatar dwblaikie avatar echristo avatar eefriedman avatar espindola avatar gribozavr avatar jrose-apple avatar lattner avatar majnemer avatar nico avatar pcc avatar r4nt avatar rjmccall avatar rnk avatar tkremenek avatar topperc avatar weverything avatar xuzhongxing avatar zmodem avatar zygoloid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

clang's Issues

lib/Driver/Tools.cpp always passing a flang internal debug option

Following line:

LowerCmdArgs.push_back("-x"); LowerCmdArgs.push_back("120"); LowerCmdArgs.push_back("0x1000"); // debug lite

Seems a strange thing to do instead of just passing a separate option for whatever profiling one need to do. Is it deliberate or done by mistake?

'make check-clang' fails on gfortran interplay test

A commit removing these two files is recommended:

test/Driver/fortran.f95
test/Driver/gfortran.f90

These two are failing on 'make check-clang' in presence on Flang commits.


Testing Time: 201.43s


Failing Tests (3):
Clang :: Driver/fortran.f95
Clang :: Driver/gfortran.f90
Clang :: Driver/nozlibcompress.c

Expected Passes : 9593
Expected Failures : 16
Unsupported Tests : 29
Unexpected Failures: 3

Flang should accept -gopt command line option

This is required in order to build software packages that use cmake. Whenever cmake is started with -DCMAKE_BUILD_TYPE=Debug or RelWithDebInfo it adds -gopt to flang command line. According to cmake scripts it adds such option as it encounters PGI compiler.

Flang should accept linker command line options

pawosm-arm commented on Sep 21, 2016
This is required by software packages that use autoconf's 'configure' script to generate makefiles. As it turns out, for some of them (e.g. openmpi) 'configure' script literally adds linker options to the command line not prefixing them with '-Wl,'. This only happens when flang is discovered by 'configure' as a frontend driver. Following options were frequently encountered (AFAIR, with singe or double dash):
--whole-archive, --no-whole-archive, --rpath (with all instances of its allowed syntax), -soname.
As a workaround, --disable-shared --enable-static (usually accompanied with setting ENV variables having -fPIC -DPIC as compiler flags) can be passed to configure. This isn't a permanent solution though, the best option would be to accept these flags and pass them to the linker as they are.
@ppenzin

ppenzin commented on Sep 21, 2016
Would other Fortran compilers accept those options?

AFAIR there is check for compiler that sets some variable to prepend -Wl, (or whatever is appropriate for particular compiler) to linker flags. If compiler is not recognized that prefix stays blank, therefore it would try to pass linker flags directly.
@pawosm-arm

pawosm-arm commented on Sep 21, 2016
They would not (I tried gfortran and some other, commercial) and the least intrusive solution needs to be found. Any solution that would require the users to update their autotools will be likely rejected by the wider audience.
@ppenzin

ppenzin commented on Sep 21, 2016
Any new compiler will have to be added to autotools at some point. For now we can probably provide a way to patch makefiles or configure scripts.

tools/clang/lib/Driver/Tools.cpp code always passes x86 options to the front-end

Following options:

-def __x86_64 -def __x86_64__ -def __amd_64__amd64__ -def __k8 -def __k8__

are always passed to flang1 on every architecture, e.g. on ARM's AArch64, e.g.:

Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: flang/bin
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/aarch64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
flang1 demo.f90 -opt 0 -terse 1 -inform warn -nohpf -nostatic -y 129 2 -inform warn -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp px -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc flang/bin/../include:/usr/local/include:flang/lib/clang/4.0.1/include:/usr/include/aarch64-linux-gnu:/include:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def __SIZE_TYPE__=unsigned long int -def __PTRDIFF_TYPE__=long int -def __THROW= -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __PGLLVM__ -freeform -vect 48 -y 54 1 -x 70 0x40000000 -y 163 0xc0000000 -x 189 0x10 -stbfile /tmp/demo-e55fd6.stb -modexport /tmp/demo-e55fd6.cmod -modindex /tmp/demo-e55fd6.cmdx -output /tmp/demo-e55fd6.ilm

Incorrect description for negating flags

The following flags have the same description as their positive versions which seems incorrect.
-fno-default-integer-8
-fno-default-real-8
-Mnocache_align
-Mnodaz

AddFlangSystemIncludeArgs() second argument name inconsistency

CC1Args vs F901Args

Linux.h:

  AddFlangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
                            llvm::opt::ArgStringList &CC1Args) const override;

Linux.cpp:

void Linux::AddFlangSystemIncludeArgs(const ArgList &DriverArgs,
                                      ArgStringList &F901Args) const

Driver passes -O1 by default

In Clang::ConstructJob:

  • // For FLANG, we want to pass -O1 as the default, iff no -O was given
  • if (IsFlang && (!Args.getLastArg(options::OPT_O_Group)))
  •  CmdArgs.push_back("-O1");
    

Shouldn't do that to make sure debugging experience is good. Let the user choose the opt level.

Debug mode builds of Flang should properly handle -fsyntax-only option

The -fsyntax-only option is very popular for testing clang. When applied to debug mode build of Flang it causes assertion fail:

tools/clang/lib/Frontend/FrontendAction.cpp:265: bool clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, const clang::FrontendInputFile&): Assertion `hasIRSupport() && "This action does not have IR file support!"' failed.

Does not occur with Release mode builds of Flang.

compilation failed due to argument unused during compilation: '-ffixed-line-length-132' (-ffixed-line-length-132 vs. -Mextend)

I know that -ffixed-line-length-132 is the gfortran's equivalent of -Mextend, unfortunately, due to gfortran popularity, -ffixed-line-length-132 can be frequently found throughout the codebase in wild. Flang ignores that option which leads to compilation errors whenever lines are too long in fixed-form code:

$ flang -c sgemm_reference.f -o sgemm_reference_mp.o  -fPIC -DPIC -ffixed-line-length-132 -fopenmp -O3
clang-4.0: warning: argument unused during compilation: '-ffixed-line-length-132' [-Wunused-command-line-argument]
F90-S-0023-Syntax error - unbalanced parentheses (sgemm_reference.f: 188)
F90-S-0310-Adjustable array can not have automatic bounds specifiers - a (sgemm_reference.f)
F90-S-0050-Assumed size array, a, is not a dummy argument (sgemm_reference.f)
F90-S-0310-Adjustable array can not have automatic bounds specifiers - b (sgemm_reference.f)
F90-S-0050-Assumed size array, b, is not a dummy argument (sgemm_reference.f)
F90-S-0310-Adjustable array can not have automatic bounds specifiers - c (sgemm_reference.f)
F90-S-0050-Assumed size array, c, is not a dummy argument (sgemm_reference.f)
  0 inform,   0 warnings,   7 severes, 0 fatal for MAIN

This is the more general issue on how much Flang should be able to act as a drop-in replacement for gfortran and therefore accept its command-line syntax.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.