Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Propagate volatile out of type to the field/var decl.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Buclaw committed Sep 7, 2012
1 parent e947206 commit ce3e42c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 30 deletions.
47 changes: 17 additions & 30 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2012-10-06 Iain Buclaw <ibuclaw@ubuntu.com>

* d-codegen.cc(AggLayout::doFields): Propagate volatile out of type.
(AggLayout::addField): Likewise.
* d-decls.cc(VarDeclaration::toSymbol): Likewise.

2012-09-06 Iain Buclaw <ibuclaw@ubuntu.com>

* d-codegen.h(IRState::vconvert): Don't use VIEW_CONVERT_EXPR.
Expand All @@ -20,36 +26,17 @@
(build_assign_math_op): Remove function, mostly move to
IRState::buildAssignOp.
(BinExp::toElemBin): Remove function.
(IdentityExp::toElem): Clean-up, use IRState::boolOp.
(EqualExp::toElem): Likewise.
(CmpExp::toElem): Likewise.
(AndAndExp::toElem): Likewise.
(OrOrExp::toElem): Likewise.
(XorExp::toElem): Use IRState::arrayOpNotImplemented,
IRState::buildOp.
(OrExp::toElem): Likewise.
(AndExp::toElem): Likewise.
(UshrExp::toElem): Likewise.
(ShrExp::toElem): Likewise.
(ShlExp::toElem): Likewise.
(ModExp::toElem): Likewise.
(DivExp::toElem): Likewise.
(MulExp::toElem): Likewise.
(MinExp::toElem): Likewise.
(AddExp::toElem): Likewise.
(XorAssignExp::toElem): Use IRState::arrayOpNotImplemented,
IRState::buildOp.
(OrAssignExp::toElem): Likewise.
(AndAssignExp::toElem): Likewise.
(UshrAssignExp::toElem): Likewise.
(ShrAssignExp::toElem): Likewise.
(ShlAssignExp::toElem): Likewise.
(ModAssignExp::toElem): Likewise.
(DivAssignExp::toElem): Likewise.
(MulAssignExp::toElem): Likewise.
(PowAssignExp::toElem): Likewise.
(MinAssignExp::toElem): Likewise.
(AddAssignExp::toElem): Likewise.
(IdentityExp::toElem, EqualExp::toElem, CmpExp::toElem)
(AndAndExp::toElem, OrOrExp::toElem): Clean-up, use IRState::boolOp.
(XorExp::toElem, OrExp::toElem, AndExp::toElem, UshrExp::toElem)
(ShrExp::toElem, ShlExp::toElem, ModExp::toElem, DivExp::toElem)
(MulExp::toElem, MinExp::toElem, AddExp::toElem):Use
IRState::arrayOpNotImplemented, IRState::buildOp.
(XorAssignExp::toElem, OrAssignExp::toElem, AndAssignExp::toElem)
(UshrAssignExp::toElem, ShrAssignExp::toElem, ShlAssignExp::toElem)
(ModAssignExp::toElem, DivAssignExp::toElem, MulAssignExp::toElem)
(MinAssignExp::toElem, AddAssignExp::toElem): Use
IRState::arrayOpNotImplemented, IRState::buildAssignOp.

* d-codegen.cc(libcall_ids): Remove _adCmpChar.
(IRState::getLibCallDecl): Remove LIBCALL_ADCMPCHAR.
Expand Down
4 changes: 4 additions & 0 deletions gcc/d/d-codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4620,6 +4620,8 @@ AggLayout::doFields (VarDeclarations *fields, AggregateDeclaration *agg)
SET_DECL_OFFSET_ALIGN (field_decl, TYPE_ALIGN (TREE_TYPE (field_decl)));
layout_decl (field_decl, 0);

TREE_THIS_VOLATILE (field_decl) = TYPE_VOLATILE (TREE_TYPE (field_decl));

if (var_decl->size (var_decl->loc))
{
gcc_assert (DECL_MODE (field_decl) != VOIDmode);
Expand Down Expand Up @@ -4657,6 +4659,8 @@ AggLayout::addField (tree field_decl, size_t offset)
Loc l (this->aggDecl_->getModule(), 1); // Must set this or we crash with DWARF debugging
g.ofile->setDeclLoc (field_decl, l);

TREE_THIS_VOLATILE (field_decl) = TYPE_VOLATILE (TREE_TYPE (field_decl));

layout_decl (field_decl, 0);
this->fieldList_.chain (field_decl);
}
Expand Down
4 changes: 4 additions & 0 deletions gcc/d/d-decls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ VarDeclaration::toSymbol (void)
TREE_CONSTANT (var_decl) = 1;
}

// Propagate volatile.
if (TYPE_VOLATILE (TREE_TYPE (var_decl)))
TREE_THIS_VOLATILE (var_decl) = 1;

#if TARGET_DLLIMPORT_DECL_ATTRIBUTES
// Have to test for import first
if (isImportedSymbol())
Expand Down

0 comments on commit ce3e42c

Please sign in to comment.