Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump GCC to 5.3.0 #111

Merged
merged 2 commits into from
Dec 28, 2015
Merged

Bump GCC to 5.3.0 #111

merged 2 commits into from
Dec 28, 2015

Conversation

palmer-dabbelt
Copy link
Contributor

No description provided.

@palmer-dabbelt
Copy link
Contributor Author

This doesn't build with "--enable-linux", I'll fix it.

There was one change required here: support for "MEMMODEL_SYNC_*".  This
very long  GCC post <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65697>
talks about the formalization of the C++ memory model.  It looks like
this is it to allow for some ARM stupidity where they can speculatively
issue some memory operations.

As far as I can tell, the right thing to do here is to just treat the
SYNC versions the same as the non-SYNC versions -- this is the same
thing ia64 and rs600 do.  I can't find "MEMMODEL_SYNC" anywhere else
interesting, so there might be some flag to set to avoid doing this, but
I couldn't find it.
This way we'll be able to see what memory model is being passed, in case
someone has another problem with additional memory models in the future.
@palmer-dabbelt
Copy link
Contributor Author

@aswaterman Can you look at the first commit? I think it's OK, but I didn't read that thread. I'm a bit worried that "grep MEMMODEL_SYNC" doesn't find what I'd expect (something in aach64).

@aswaterman
Copy link
Collaborator

I read some of the bugzilla thread and I think we're OK. The test program

int test(int* foo, int* bar)
{
  int x = __sync_fetch_and_add(foo, 1);
  return *bar;
}

produces the assembly code

li a5,1
amoadd.w.sc zero,a5,0(a0)
lw a0,0(a1)
ret

and by my reading of the RISC-V memory model, the load cannot be perceived
to have executed before the AMO.

On Sun, Dec 27, 2015 at 8:03 PM, Palmer Dabbelt notifications@github.com
wrote:

@aswaterman https://github.com/aswaterman Can you look at the first
commit? I think it's OK, but I didn't read that thread. I'm a bit worried
that "grep MEMMODEL_SYNC" doesn't find what I'd expect (something in
aach64).


Reply to this email directly or view it on GitHub
#111 (comment)
.

@aswaterman
Copy link
Collaborator

So, if you've fixed the --enable-linux build, I'm OK to merge.

palmer-dabbelt added a commit that referenced this pull request Dec 28, 2015
@palmer-dabbelt palmer-dabbelt merged commit 105ffc3 into master Dec 28, 2015
@palmer-dabbelt palmer-dabbelt deleted the gcc-5.3 branch December 28, 2015 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants