[llvm-dev] difference between llvm-gcc and clang

Yuxi Chen via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 22 17:20:12 PDT 2016

Hi Tim, 

Thanks for your reply. 
I know O4 is same as O3 now. I am wondering the bitcodes generated by llvm-gcc and clang  are same, or almost same, I mean they are almost same, but maybe some newly-created  optimization would exert impact. 

From: Tim Northover [t.p.northover at gmail.com]
Sent: Thursday, July 21, 2016 4:11 PM
To: Yuxi Chen
Cc: llvmdev at cs.uiuc.edu; llvm-dev at lists.llvm.org; llvmdev-bounces at cs.uiuc.edu
Subject: Re: [llvm-dev] difference between llvm-gcc and clang

On 21 July 2016 at 14:02, Yuxi Chen via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Both llvm-gcc and clang would use llvm as its backend. Dose everyone know
> the difference of bitcode generated by llvm-gcc and llvm?

llvm-gcc used to be a compiler that used the GCC front-end (C parser
etc) to generate LLVM IR and then used the LLVM backends. It's a
long-abandoned project now though (not updated past GCC 4.2), with all
effort going into Clang (or GCC proper!).

You're only even likely to find traces of it on macOS, where
/usr/bin/llvm-gcc exists for backwards-compatibility reasons. However,
that's not really llvm-gcc any more, it's just another way to run

> Or actually they are same, like if I use the same compiler options, like -O4.

You shouldn't be using -O4. At one point I think it was a weird way to
trigger LTO (now you'd use -flto), but it's now only accepted for
compatibility and means the same thing as -O3. It gives you a warning
if you try to use it.



More information about the llvm-dev mailing list