Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
what is best in optimizer pipeline
value numbering
code motion
peepholing
loop idiom recognition
legalization
thread gassing
op banning
View Results
 
  • Locked thread
pram
Jun 10, 2001
cum pilers

Adbot
ADBOT LOVES YOU

echinopsis
Apr 13, 2004

by Fluffdaddy
sick but fair

Mikey-San
Nov 3, 2005

I'm Edith Head!

pram posted:

cum pilers

-Oface

TOPS-420
Feb 13, 2012

pyf compiler bugs

https://reviews.llvm.org/rL307092

quote:

If the output file is a character file (e.g. /dev/null) unlinking it could
potentially destabilize the user's system. For example,
unlinking causes lld %input -o /dev/null to replace /dev/null with a
regular file, which will lead to unexpected behavior in other programs
that read from /dev/null, and worse than expected peformance for
programs that write to /dev/null.

thansk systemdlld

The Management
Jan 2, 2010

sup, bitch?
that sounds like an os bug to me

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
yeah it seems like you shouldn't be able to unlink /dev/null without root access.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

MALE SHOEGAZE posted:

yeah it seems like you shouldn't be able to unlink /dev/null without root access.

you can't.

that purpose of that change seems to be about making it possible to run the build script as root. not sure why that's a desirable thing to support.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
it looks like you can't and the bug is specifically about making it safer to run the linker as root?

what the gently caress

gonadic io
Feb 16, 2011

>>=

TOPS-420 posted:

pyf compiler bugs

https://mobile.twitter.com/bos31337/status/116372971509121025

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

working as intended

TOPS-420
Feb 13, 2012

https://twitter.com/johnregehr/status/695271704982069248

The Management
Jan 2, 2010

sup, bitch?
do I know anyone stupid enough to run the linker as root 🤔

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

The Management posted:

do I know anyone stupid enough to run the linker as root 🤔

uh literally anyone running it in a docker

crazypenguin
Mar 9, 2005
nothing witty here, move along
i'm pretty sure anyone that run 'sudo gem install blah' is probably running compilers/linkers as root

akadajet
Sep 14, 2003

I'm happy I don't program in C or C++

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

I love the (unsigned)-1.0F is a random value, that must have been incredibly frustrating to track down

The Management
Jan 2, 2010

sup, bitch?
let me rephrase that. I know a lot of idiots running compilers and linkers as root

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
if you've ever typed sudo make install without running make first you've probably run a linker as root. it's obviously not something you should be doing, but it's not at all hard to do accidentally

MrMoo
Sep 14, 2000

Sweeper posted:

I love the (unsigned)-1.0F is a random value, that must have been incredibly frustrating to track down

Honestly that is a lot of screams terrible developer.

JawnV6
Jul 4, 2004

So hot ...

DuckConference posted:

the volatile write was to a global variable, right, and not to something local like a pointer you declared locally within the function?
rjmccall was right, control flow

JawnV6 fucked around with this message at 08:42 on Jul 11, 2017

Guacamayo
Feb 2, 2012
why is it bad to run the linker as root?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
programs really should not be run as root unless they've been designed to be extremely cautious about how they interact with the system. the average toolchain is no more designed to work that way than a word processor is

i mean, it's not really a security hole on its own, not unless you're doing something that should set off warning bells in anyone not completely oblivious, like writing a compilation server or making the compiler setuid. but it does create a lot of unnecessary potential for bugs to completely gently caress over your system

Angela Merkle Tree
Jan 4, 2012

the definition of open: "mkdir android ; cd android ; repo init -u git://android.git.kernel.org/platform/manifest.git ; repo sync ; make"
College Slice
spent two weeks on my own hobby compiler trying to figure out why it's stack implementation returned 10006 for (5000 + 3 + 2)

turns out the assembler had a destructive check in an inner loop instead of an outer loop when evaluating index-plus-offset (like stack[ebp - 4]) variables

it would get emitted as stack[ebp - 4] once, then as stack[ebp] for the rest of the uses of that variable

holy poo poo i was so mad at myself when i finally figured it out

Spatial
Nov 15, 2007

compilers are fun. i wrote at one at work a couple of years ago for an embedded scripting language and learned a lot doing it. the feature i'm the most proud of is the nice error reporting system which underlines errors with token-level granularity and gives sensible human-friendly messages. at the time, this was better than any real compiler we used.

i found several fun bugs during development. my favourite was a performance issue where the compiler seemingly got exponentially slower the longer the input text was. after a few hours of profiling which didn't really help, i finally noticed that i had written:
C++ code:
class ExpressionParser {
    TokenStream stream;
};
problem being that "stream" is supposed to be a reference, not a value. since the compiler works by recursive descent this caused the entire input+metadata to be copied every single time the expression parser recursed, which it does once/twice per operator. one of those classic coding moments where my entire day's work was changing one character for a thousand times performance improvement. :v:

The Management
Jan 2, 2010

sup, bitch?

Spatial posted:

one of those classic coding moments where my entire day's work was changing one character for a thousand times performance improvement. :v:

more like one of those moments when you realize why C++ is a terrible language

JawnV6
Jul 4, 2004

So hot ...
what's the over/under for how long before BDCE gets too clever and exposes a timing attack

TOPS-420
Feb 13, 2012

p sure that's already happened. timing sensitive code these days more or less has to be hand-rolled assembly language

Spatial
Nov 15, 2007

The Management posted:

more like one of those moments when you realize why C++ is a terrible language
at the time my choices were C89 and C++11. that said, i still like it even though it really can be terrible

still copy and pasting code with #include in 2017! :downs:

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

TOPS-420 posted:

p sure that's already happened. timing sensitive code these days more or less has to be hand-rolled assembly language

I don't know who u are but sick username

maskenfreiheit
Dec 30, 2004
as a millennial with limited attention span I can only use interpreted language s like Python

JewKiller 3000
Nov 28, 2006

by Lowtax
you should try java, it will teach you how to actually program and get a real legitimate job

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

JewKiller 3000 posted:

you should try java, it will teach you how to actually program and get a real legitimate job

Or write lines of code so long they wrap thrice

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
Like seriously, give me a type def operator java

JewKiller 3000
Nov 28, 2006

by Lowtax
if you feel the need for typedef you probably need to make a class

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

JewKiller 3000 posted:

if you feel the need for typedef you probably need to make a class

It's more like when you end up with ExtensibleFoo<BarResult, String, BazContainer<Baz>> myExtFoo = ThingReturner<and the rest>() ;

I wish I could typedef the type there.

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

JewKiller 3000 posted:

you should try java, it will teach you how to actually program and get a real legitimate job

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

cis autodrag posted:

It's more like when you end up with ExtensibleFoo<BarResult, String, BazContainer<Baz>> myExtFoo = ThingReturner<and the rest>() ;

I wish I could typedef the type there.

C++'s auto works p good here

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Poopernickel posted:

C++'s auto works p good here

Java hypothetically had the <> operator but this scenario it doesn't work for. I don't know if I'd want var or auto for this as I'd one the lhs to still carry some meaning, but being able to do like


Java code:

@alias
MyFooMess = //that whole messy lhs 

Would be awesome.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
<T extends HotMess<OfShit>> void doStuff() {
T thing = getThing()
}


You might need to have a parameter or something that actually uses that type, idk. And you're really just punting the problem up to whatever calls this method.

Adbot
ADBOT LOVES YOU

flakeloaf
Feb 26, 2003

Still better than android clock

maskenfreiheit posted:

as a millennial with limited attention span I can only use interpreted language s like Python

kids today never make time for smalltalk

  • Locked thread